Annotation

Inheritance: java.lang.Object, com.aspose.pdf.BaseParagraph

public abstract class Annotation extends BaseParagraph

Class representing annotation object.

Methods

MethodDescription
initialize(IDocument doc)Instance initialization
getEngineObj()For Internal usage only
getEngineDict()Internal only
isUpdateAppearanceOnConvert()If true, annotation appearance will be updated before converting PDF document into image.
setUpdateAppearanceOnConvert(boolean value)If true, annotation appearance will be updated before converting PDF document into image.
isUseFontSubset()If this property set to true, fonts will be added to document as subsets.
setUseFontSubset(boolean value)If this property set to true, fonts will be added to document as subsets.
getNormalAppearance()Gets normal appearance.
getFlags()Get flags of the annotation.
setFlags(int value)Set flags of the annotation.
getPage()Gets the page object with which this annotation is associated.
getAnnotationType()Gets type of annotation.
getWidth()Gets width of the annotation.
setWidth(double value)Sets width of the annotation.
getPdfActions()Gets list of annotation actions.
getHeight()Gets height of the annotation.
setHeight(double value)Sets height of the annotation.
getRect()Gets annotation rectangle.
setRect(Rectangle value)Sets annotation rectangle.
getRectangle(boolean considerRotation)Returns rectangle of annotation taking into consideration page rotation.
getContents()Gets annotation text.
setContents(String value)Sets annotation text.
getName()Gets annotation name on the page.
setName(String value)Sets annotation name on the page.
getModifiedInternal()Gets date and time when annotation was recently modified.
getModified()Gets date and time when annotation was recently modified.
setModifiedInternal(System.DateTime value)Sets date and time when annotation was recently modified.
setModified(Date value)Sets date and time when annotation was recently modified.
getColor()Gets annotation color.
setColor(Color value)Sets annotation color.
getBorder()Gets annotation border characteristics.
setBorder(Border value)Sets annotation border characteristics.
getActiveState()Gets current annotation appearance state.
setActiveState(String value)Sets current annotation appearance state.
getCharacteristics()Gets annotation characteristics.
getStates()Gets appearance dictionary of annotation.
getAlignment()Annotation alignment.
setAlignment(TextAlignment value)Annotation alignment.
getHorizontalAlignment_Annotation_New()Gets or sets text alignment for annotation.
setHorizontalAlignment_Annotation_New(HorizontalAlignment value)Gets or sets text alignment for annotation.
getTextHorizontalAlignment()Gets text alignment for annotation.
setTextHorizontalAlignment(HorizontalAlignment value)Sets text alignmennt for annotation.
createAnnotation(IPdfObject annotEngineObj, Page page)For internal usage only
accept(AnnotationSelector visitor)Accepts visitor for annotation processing.
flatten()Places annotation contents directly on the page, annotation object will be removed.
getFullName()Gets full qualified name of the annotation.
getAppearance()Gets appearance dictionary of the annotation.
changeAfterResize(Matrix transform)Update parameters and appearance, according to the matrix transform.
getPageIndex()Gets index of page which contains annotation.
getPageIndex(Annotation annotation)Gets index of page which contains annotation.

initialize(IDocument doc)

public void initialize(IDocument doc)

Instance initialization

Parameters:

ParameterTypeDescription
docIDocumentIDocument object

getEngineObj()

public IPdfObject getEngineObj()

For Internal usage only

Returns: IPdfObject - Internal onject

getEngineDict()

public IPdfDictionary getEngineDict()

Internal only

Returns: IPdfDictionary - IPdfDictionary object

isUpdateAppearanceOnConvert()

public static synchronized boolean isUpdateAppearanceOnConvert()

If true, annotation appearance will be updated before converting PDF document into image. This allows convert fields correctly but probably demand more time.

Returns: boolean - boolean value

setUpdateAppearanceOnConvert(boolean value)

public static synchronized void setUpdateAppearanceOnConvert(boolean value)

If true, annotation appearance will be updated before converting PDF document into image. This allows convert fields correctly but probably demand more time.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

isUseFontSubset()

public static synchronized boolean isUseFontSubset()

If this property set to true, fonts will be added to document as subsets. Default value is true.

Returns: boolean - boolean value

setUseFontSubset(boolean value)

public static synchronized void setUseFontSubset(boolean value)

If this property set to true, fonts will be added to document as subsets. Default value is true.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getNormalAppearance()

public XForm getNormalAppearance()

Gets normal appearance.

Returns: XForm - XForm object

getFlags()

public int getFlags()

Get flags of the annotation.

Returns: int - Flags of the annotation

setFlags(int value)

public void setFlags(int value)

Set flags of the annotation.

Parameters:

ParameterTypeDescription
valueintflags of the annotation

getPage()

public Page getPage()

Gets the page object with which this annotation is associated.

Returns: Page - Page object

getAnnotationType()

public abstract AnnotationType getAnnotationType()

Gets type of annotation.

Returns: AnnotationType - int value

getWidth()

public double getWidth()

Gets width of the annotation.

Returns: double - double value, width of the annotation.

setWidth(double value)

public void setWidth(double value)

Sets width of the annotation.

Parameters:

ParameterTypeDescription
valuedoublewidth of the annotation.

getPdfActions()

public PdfActionCollection getPdfActions()

Gets list of annotation actions.

Returns: PdfActionCollection - PdfActionCollection instance

getHeight()

public double getHeight()

Gets height of the annotation.

Returns: double - height of the annotation

setHeight(double value)

public void setHeight(double value)

Sets height of the annotation.

Parameters:

ParameterTypeDescription
valuedoubleheight of the annotation

getRect()

public Rectangle getRect()

Gets annotation rectangle.

Returns: Rectangle - Rectangle object

setRect(Rectangle value)

public void setRect(Rectangle value)

Sets annotation rectangle.

Parameters:

ParameterTypeDescription
valueRectangleRectangle value

getRectangle(boolean considerRotation)

public Rectangle getRectangle(boolean considerRotation)

Returns rectangle of annotation taking into consideration page rotation.

Parameters:

ParameterTypeDescription
considerRotationbooleanIf true, page rotation is taken into consideration.

Returns: Rectangle - Rectangle object

getContents()

public String getContents()

Gets annotation text.

Returns: java.lang.String - String value

setContents(String value)

public void setContents(String value)

Sets annotation text.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getName()

public String getName()

Gets annotation name on the page.

Returns: java.lang.String - String value

setName(String value)

public void setName(String value)

Sets annotation name on the page.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getModifiedInternal()

public System.DateTime getModifiedInternal()

Gets date and time when annotation was recently modified.

Returns: com.aspose.ms.System.DateTime - DateTime object

getModified()

public Date getModified()

Gets date and time when annotation was recently modified.

Returns: Date - date and time when annotation was recently modified.

setModifiedInternal(System.DateTime value)

public void setModifiedInternal(System.DateTime value)

Sets date and time when annotation was recently modified.

Parameters:

ParameterTypeDescription
valuecom.aspose.ms.System.DateTimeDateTime object

setModified(Date value)

public void setModified(Date value)

Sets date and time when annotation was recently modified.

Parameters:

ParameterTypeDescription
valuejava.util.DateDate object

getColor()

public Color getColor()

Gets annotation color.

Returns: Color - Color object

setColor(Color value)

public void setColor(Color value)

Sets annotation color.

Parameters:

ParameterTypeDescription
valueColorColor value

getBorder()

public Border getBorder()

Gets annotation border characteristics. Border

Returns: Border - Border object

setBorder(Border value)

public void setBorder(Border value)

Sets annotation border characteristics. Border

Parameters:

ParameterTypeDescription
valueBorderBorder value

getActiveState()

public String getActiveState()

Gets current annotation appearance state.

Returns: java.lang.String - String value

setActiveState(String value)

public void setActiveState(String value)

Sets current annotation appearance state.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getCharacteristics()

public Characteristics getCharacteristics()

Gets annotation characteristics.

Returns: Characteristics - Characteristics object

getStates()

public AppearanceDictionary getStates()

Gets appearance dictionary of annotation.

Returns: AppearanceDictionary - AppearanceDictionary object

getAlignment()

public TextAlignment getAlignment()

Annotation alignment. This property is obsolete. Use getHorizontalAlignment_Annotation_New instead.

Returns: TextAlignment - TextAlignment element

setAlignment(TextAlignment value)

public void setAlignment(TextAlignment value)

Annotation alignment. This property is obsolete. Use getHorizontalAlignment_Annotation_New instead.

Parameters:

ParameterTypeDescription
valueTextAlignmentTextAlignment element

getHorizontalAlignment_Annotation_New()

public final HorizontalAlignment getHorizontalAlignment_Annotation_New()

Gets or sets text alignment for annotation.

Returns: HorizontalAlignment - text alignment for annotation.

setHorizontalAlignment_Annotation_New(HorizontalAlignment value)

public final void setHorizontalAlignment_Annotation_New(HorizontalAlignment value)

Gets or sets text alignment for annotation.

Parameters:

ParameterTypeDescription
valueHorizontalAlignmenttext alignmennt for annotation.

getTextHorizontalAlignment()

public HorizontalAlignment getTextHorizontalAlignment()

Gets text alignment for annotation.

Returns: HorizontalAlignment - text alignment for annotation.

setTextHorizontalAlignment(HorizontalAlignment value)

public void setTextHorizontalAlignment(HorizontalAlignment value)

Sets text alignmennt for annotation.

Parameters:

ParameterTypeDescription
valueHorizontalAlignmenttext alignmennt for annotation.

createAnnotation(IPdfObject annotEngineObj, Page page)

public static Annotation createAnnotation(IPdfObject annotEngineObj, Page page)

For internal usage only

Initializes annotation from PDF object which describes the annotation.

Parameters:

ParameterTypeDescription
annotEngineObjIPdfObjectPDF object describing annotation
pagePagePage object

Returns: Annotation - Created annotation object of appropriate type

accept(AnnotationSelector visitor)

public abstract void accept(AnnotationSelector visitor)

Accepts visitor for annotation processing.

Parameters:

ParameterTypeDescription
visitorAnnotationSelectorAnnotationSelector object.

flatten()

public void flatten()

Places annotation contents directly on the page, annotation object will be removed.

getFullName()

public String getFullName()

Gets full qualified name of the annotation.

Returns: java.lang.String - String value

getAppearance()

public AppearanceDictionary getAppearance()

Gets appearance dictionary of the annotation.

Returns: AppearanceDictionary - AppearanceDictionary object

changeAfterResize(Matrix transform)

public void changeAfterResize(Matrix transform)

Update parameters and appearance, according to the matrix transform.

Parameters:

ParameterTypeDescription
transformMatrixMatrix that use for transformation (resize).

getPageIndex()

public int getPageIndex()

Gets index of page which contains annotation.

Returns: int - int value

getPageIndex(Annotation annotation)

public int getPageIndex(Annotation annotation)

Gets index of page which contains annotation.

Parameters:

ParameterTypeDescription
annotationAnnotationAnnotation object

Returns: int - int value