Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.pdf.annots.Annot Class Reference
Inheritance diagram for com.foxit.sdk.pdf.annots.Annot:

## Public Member Functions
| Annot ()
| Constructor.
| Annot (Annot annot)
| Constructor, with another annotation object. More...
| Annot (PDFPage page, PDFDictionary annot_dict) throws com.foxit.sdk.PDFException
| Constructor, with PDF page and annotation's PDF dictionary. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
PDFStream | getAppearanceStream (int type, String appearance_state) throws com.foxit.sdk.PDFException
| Get annotation's appearance stream with specified type and state. More...
long | getBorderColor () throws com.foxit.sdk.PDFException
| Get border color. More...
BorderInfo | getBorderInfo () throws com.foxit.sdk.PDFException
| Get border information. More...
String | getContent () throws com.foxit.sdk.PDFException
| Get content. More...
RectI | getDeviceRect (Matrix2D matrix) throws com.foxit.sdk.PDFException
| Get annotation rectangle in device coordinate system. More...
PDFDictionary | getDict () throws com.foxit.sdk.PDFException
| Get annotation's dictionary object. More...
Matrix2D | getDisplayMatrix (Matrix2D page_display_matrix) throws com.foxit.sdk.PDFException
| Get the display matrix, from PDF coordinate system to targeted device coordinate system. More...
int | getFlags () throws com.foxit.sdk.PDFException
| Get annotation flags. More...
int | getIndex () throws com.foxit.sdk.PDFException
| Get the index of current annotation in the page which current annotation belongs to. More...
DateTime | getModifiedDateTime () throws com.foxit.sdk.PDFException
| Get last modified date time. More...
PDFDictionary | getOptionalContent () throws com.foxit.sdk.PDFException
| Get the PDF dictionary of annotation's optional content. More...
PDFPage | getPage () throws com.foxit.sdk.PDFException
| Get the related PDF page. More...
RectF | getRect () throws com.foxit.sdk.PDFException
| Get rectangle, in PDF coordinate system. More...
int | getType () throws com.foxit.sdk.PDFException
| Get actual annotation type of current annotation. More...
String | getUniqueID () throws com.foxit.sdk.PDFException
| Get unique ID. More...
boolean | hasProperty (int property) throws com.foxit.sdk.PDFException
| Whether current annotation has the specified annotation's property. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
boolean | isMarkup () throws com.foxit.sdk.PDFException
| Check if current annotation is a markup annotation. More...
boolean | move (RectF rect) throws com.foxit.sdk.PDFException
| Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More...
boolean | move (RectF rect, boolean is_reset_appearance) throws com.foxit.sdk.PDFException
| Move current annotation to a new position, specified by a new rectangle in PDF coordinate system. More...
boolean | removeProperty (int property) throws com.foxit.sdk.PDFException
| Remove a specified annotation's property. More...
boolean | resetAppearanceStream () throws com.foxit.sdk.PDFException
| Reset appearance stream. More...
boolean | resetAppearanceStream (boolean is_generate_new_appearance_obj) throws com.foxit.sdk.PDFException
| Reset appearance stream. More...
void | setBorderColor (long color) throws com.foxit.sdk.PDFException
| Set border color. More...
void | setBorderInfo (BorderInfo border) throws com.foxit.sdk.PDFException
| Set border information. More...
void | setContent (String content) throws com.foxit.sdk.PDFException
| Set content. More...
void | setFlags (int flags) throws com.foxit.sdk.PDFException
| Set annotation flags. More...
void | setModifiedDateTime (DateTime date_time) throws com.foxit.sdk.PDFException
| Set last modified date time. More...
void | setUniqueID (String unique_id) throws com.foxit.sdk.PDFException
| Set unique ID. More...

## Static Public Attributes
static final int | e_3D = 25
| Annotation type: 3D annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_AppearanceTypeDown = 2
| Annotation's down appearance.
static final int | e_AppearanceTypeNormal = 0
| Annotation's normal appearance.
static final int | e_AppearanceTypeRollover = 1
| Annotation's rollover appearance.
static final int | e_Caret = 14
| Annotation type: caret annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Circle = 6
| Annotation type: circle annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_FileAttachment = 17
| Annotation type: file attachment annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_FlagHidden = 0x0002
| Annotation flag: hidden. More...
static final int | e_FlagInvisible = 0x0001
| Annotation flag: invisible. More...
static final int | e_FlagLocked = 0x0080
| Annotation flag: locked. More...
static final int | e_FlagLockedContents = 0x0200
| Annotation flag: locked contents. More...
static final int | e_FlagNoRotate = 0x0010
| Annotation flag: no rotate. More...
static final int | e_FlagNoView = 0x0020
| Annotation flag: no view. More...
static final int | e_FlagNoZoom = 0x0008
| Annotation flag: no zoom. More...
static final int | e_FlagPrint = 0x0004
| Annotation flag: print. More...
static final int | e_FlagReadOnly = 0x0040
| Annotation flag: read only. More...
static final int | e_FlagToggleNoView = 0x0100
| Annotation flag: toggle no view. More...
static final int | e_FreeText = 3
| Annotation type: free text annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Highlight = 9
| Annotation type: highlight annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_HighlightingInvert = 1
| Highlighting mode: Invert, which is to invert the contents of the annotation rectangle.
static final int | e_HighlightingNone = 0
| Highlighting mode: No highlighting.
static final int | e_HighlightingOutline = 2
| Highlighting mode: Outline, which is to invert the annotation's border.
static final int | e_HighlightingPush = 3
| Highlighting mode: Push, which is to display the annotation's down appearance, if any.
static final int | e_HighlightingToggle = 4
| Highlighting mode: Toggle. This is only useful for widget annotation.
static final int | e_Ink = 15
| Annotation type: ink annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Line = 4
| Annotation type: line annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Link = 2
| Annotation type: link annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_MKEntryBackgroundColor = 2
| Background color entry. "BG" in MK dictionary.
static final int | e_MKEntryBorderColor = 1
| Border color entry. "BC" in MK dictionary.
static final int | e_MKEntryDownCaption = 5
| Down caption (or alternate caption) entry. "AC" in MK dictionary. More...
static final int | e_MKEntryDownIcon = 8
| Down icon (or alternate icon) entry. "IX" in MK dictionary. More...
static final int | e_MKEntryIconCaptionRelation = 10
| Icon and caption relation entry. "TP" in MK dictionary. More...
static final int | e_MKEntryIconFit = 9
| Icon fit information entry. "IF" in MK dictionary. More...
static final int | e_MKEntryNormalCaption = 3
| Normal caption entry. "CA" in MK dictionary. More...
static final int | e_MKEntryNormalIcon = 6
| Normal icon entry. "I" in MK dictionary. More...
static final int | e_MKEntryRolloverCaption = 4
| Rollover caption entry. "RC" in MK dictionary. More...
static final int | e_MKEntryRolloverIcon = 7
| Rollover icon entry. "RI" in MK dictionary. More...
static final int | e_MKEntryRotation = 0
| Rotation entry. "R" in MK dictionary.
static final int | e_MKRelationCaptionAboveIcon = 3
| Caption above the icon.
static final int | e_MKRelationCaptionBelowIcon = 2
| Caption below the icon.
static final int | e_MKRelationCaptionLeft = 5
| Caption to the left of the icon.
static final int | e_MKRelationCaptionOvrlayOnIcon = 6
| Caption overlaid directly on the icon.
static final int | e_MKRelationCaptionRight = 4
| Caption to the right of the icon.
static final int | e_MKRelationNoCaption = 1
| No caption; icon only.
static final int | e_MKRelationNoIcon = 0
| No icon; captin only.
static final int | e_Movie = 19
| Annotation type: movie annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Note = 1
| Annotation type: note annotation, which is just "Text" annotation - one of standard annotation in <PDF reference 1.7>.
static final int | e_PagingSeal = 29
| Annotation type: paging seal annotation. A Foxit PDF SDK custom annotation type (not a standard annotation type).
static final int | e_Polygon = 7
| Annotation type: polygon annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_PolyLine = 8
| Annotation type: polyline annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Popup = 26
| Annotation type: pop-up annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_PrinterMark = 22
| Annotation type: printer's mark annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_PropertyBorderColor = 2
| Annotation property: border color. More...
static final int | e_PropertyCreationDate = 1
| Annotation property: creation date. More...
static final int | e_PropertyFillColor = 3
| Annotation property: fill color. More...
static final int | e_PropertyModifiedDate = 0
| Annotation property: modified date.
static final int | e_PSInk = 16
| Annotation type: pressure sensitive ink annotation.
static final int | e_Redact = 27
| Annotation type: redact annotation.
static final int | e_RichMedia = 28
| Annotation type: rich media annotation.
static final int | e_Screen = 21
| Annotation type: screen annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Sound = 18
| Annotation type: sound annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Square = 5
| Annotation type: square annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Squiggly = 11
| Annotation type: squiggly annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Stamp = 13
| Annotation type: stamp annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_StrikeOut = 12
| Annotation type: strikeout annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_TrapNet = 23
| Annotation type: trap network annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Underline = 10
| Annotation type: underline annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_UnknownType = 0
| Annotation type: unknown.
static final int | e_Watermark = 24
| Annotation type: watermark annotation. One of standard annotation in <PDF reference 1.7>.
static final int | e_Widget = 20
| Annotation type: widget annotation. One of standard annotation in <PDF reference 1.7>. More...

## Detailed Description

An annotation associates an object such as a note, sound, or movie with a location on a page of a PDF document, or provides a way to interact with the user by means of the mouse and keyboard. PDF includes a wide variety of standard annotation types.
Class Annot is the base class for all kinds of PDF annotations. It offers the base functions to get/set annotation's common properties, to move an annotation or reset appearance stream of an annotation. For concrete annotation types, please refer to derived classes. To get the count of annotations or get/add/remove an annotation, please refer to class pdf::PDFPage.
This class object can also be used to construct objects of other classes in order to do some more operation in annotation or access specified information of annotation:

- To access additional actions, please construct an com.foxit.sdk.pdf.actions.AdditionalAction object with annotation object. Only a few types of annotations may have additional action. For more details, please refer to class com.foxit.sdk.pdf.actions.AdditionalAction .
- To search text in annotation, please construct a com.foxit.sdk.pdf.TextSearch object with annotation object. The searching can only support some types of annotations. For more details, please refer to class com.foxit.sdk.pdf.TextSearch .

Note
  Currently, following kind of functions only support note, highlight, underline, strikeout, squiggly, link, square, circle, free text, stamp, caret, ink, line, polygon, polyline, file attachment, pop-up, widget, screen, PSInk, redact annotations:
  - All the "set" functions in class Annot .
  - Functions Annot.move , Annot.resetAppearanceStream , Annot.removeProperty .

See also
  com.foxit.sdk.pdf.PDFPage
  com.foxit.sdk.pdf.actions.AdditionalAction
  com.foxit.sdk.pdf.TextSearch

## Constructor & Destructor Documentation

## ◆ Annot() [1/2]

com.foxit.sdk.pdf.annots.Annot.Annot | ( | PDFPage | page,
|  | PDFDictionary | annot_dict
| ) |  | throws com.foxit.sdk.PDFException

Constructor, with PDF page and annotation's PDF dictionary.

Parameters

  [in] | page | A valid PDF page.
  [in] | annot_dict | An annotation's PDF dictionary. It should represent an annotation and should be in the PDF page specified by parameter page.

## ◆ Annot() [2/2]

com.foxit.sdk.pdf.annots.Annot.Annot | ( | Annot | annot | ) |

Constructor, with another annotation object.

Parameters

  [in] | annot | Another annotation object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.pdf.annots.Annot.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

Reimplemented in com.foxit.sdk.pdf.annots.Widget, com.foxit.sdk.pdf.annots.Screen, com.foxit.sdk.pdf.annots.FreeText, com.foxit.sdk.pdf.annots.FileAttachment, com.foxit.sdk.pdf.annots.Link, com.foxit.sdk.pdf.annots.Sound, com.foxit.sdk.pdf.annots.Stamp, com.foxit.sdk.pdf.annots.Caret, com.foxit.sdk.pdf.annots.Circle, com.foxit.sdk.pdf.annots.Ink, com.foxit.sdk.pdf.annots.Line, com.foxit.sdk.pdf.annots.Markup, com.foxit.sdk.pdf.annots.Note, com.foxit.sdk.pdf.annots.PagingSeal, com.foxit.sdk.pdf.annots.Polygon, com.foxit.sdk.pdf.annots.PolyLine, com.foxit.sdk.pdf.annots.Square, com.foxit.sdk.pdf.annots.Highlight, com.foxit.sdk.pdf.annots.Popup, com.foxit.sdk.pdf.annots.PSInk, com.foxit.sdk.pdf.annots.Redact, com.foxit.sdk.pdf.annots.Squiggly, com.foxit.sdk.pdf.annots.StrikeOut, com.foxit.sdk.pdf.annots.TextMarkup, and com.foxit.sdk.pdf.annots.Underline.

## ◆ getAppearanceStream()

PDFStream com.foxit.sdk.pdf.annots.Annot.getAppearanceStream | ( | int | type,
|  | String | appearance_state
| ) |  | throws com.foxit.sdk.PDFException

Get annotation's appearance stream with specified type and state.

For more details, please refer to "AP" and "AS" entries in "TABLE 8.15 Entries common to all annotation dictionaries" in <PDF reference 1.7>.

Parameters

  [in] | type | Type of annotation's appearance. Please refer to values starting from com.foxit.sdk.pdf.annots.Annot.e_AppearanceTypeNormal and this should be one of these values.
  [in] | appearance_state | Annotation's appearance state, which is used to select the applicable appearance stream from an appearance sub-dictionary. If this is an empty string, Foxit PDF SDK will choose the appearance state specified by the "AS" (Appearance State) entry in the annotation dictionary.

Returns
  The specified annotation's appearance stream. If there is no entry which related to appearance or any error occurs, this function will return null.

## ◆ getBorderColor()

long com.foxit.sdk.pdf.annots.Annot.getBorderColor | ( |  | ) | throws com.foxit.sdk.PDFException

Get border color.

This property has effect on annotation's appearance.

Returns
  The border color. Format: 0xRRGGBB. If no border color can be found, 0x000000 will be returned.

## ◆ getBorderInfo()

BorderInfo com.foxit.sdk.pdf.annots.Annot.getBorderInfo | ( |  | ) | throws com.foxit.sdk.PDFException

Get border information.

This property has effect on annotation's appearance. For an annotation which does not have border information, the default border information will be returned:
border width = 1, border style = com.foxit.sdk.pdf.annots.BorderInfo.e_Solid , border cloud intensity = 0, border dash phase = 0, border dashes array is an empty array. Attention: among supported annotation types (please refer to "Note" comment part of class Annot ), this property will not have effect on appearance of these annotations: note, highlight, underline, strikeout, squiggly, stamp, caret, popup, file attachment, PSInk, redact. For ink annotation, only border width will have effect on ink annotation's appearance.

Returns
  A border information object that received the border information. If not find any border information, the default border information will be returned as described in "Details" part.

## ◆ getContent()

String com.foxit.sdk.pdf.annots.Annot.getContent | ( |  | ) | throws com.foxit.sdk.PDFException

Get content.

Returns
  Content string.

## ◆ getDeviceRect()

RectI com.foxit.sdk.pdf.annots.Annot.getDeviceRect | ( | Matrix2D | matrix | ) | throws com.foxit.sdk.PDFException

Get annotation rectangle in device coordinate system.

This is a useful function to get the device rectangle of an annotation, but not support pop-up annotation.
For the rectangle conversion, the result rectangle is always "normalized", which is using device coordinate system: left is always smaller than right, and top is always smaller than bottom.

Parameters

  [in] | matrix | A matrix used to transform from PDF coordinate system to device coordinate system. Usually, this is returned by function pdf.PDFPage.getDisplayMatrix and also used for rendering.

Returns
  The annotation rectangle in device coordinate system. If there is no rectangle information, a RectI object with all 0 values would be returned.

## ◆ getDict()

PDFDictionary com.foxit.sdk.pdf.annots.Annot.getDict | ( |  | ) | throws com.foxit.sdk.PDFException

Get annotation's dictionary object.

Returns
  Annotation's dictionary. If there is any error, this function will return null.

## ◆ getDisplayMatrix()

Matrix2D com.foxit.sdk.pdf.annots.Annot.getDisplayMatrix | ( | Matrix2D | page_display_matrix | ) | throws com.foxit.sdk.PDFException

Get the display matrix, from PDF coordinate system to targeted device coordinate system.

Display matrix of current annotation can be used with annotation's rectangle to calculate the real area of annotation in target device coordinate system.

Parameters

  [in] | page_display_matrix | The transformation matrix. Usually this is returned by function PDFPage.getDisplayMatrix .

Returns
  The display matrix of current annotation.

## ◆ getFlags()

int com.foxit.sdk.pdf.annots.Annot.getFlags | ( |  | ) | throws com.foxit.sdk.PDFException

Get annotation flags.

Returns
  The annotation flags. Please refer to values starting from com.foxit.sdk.pdf.annots.Annot.e_FlagInvisible and this would be one or a combination of these values. 0 means no annotation flag.

## ◆ getIndex()

int com.foxit.sdk.pdf.annots.Annot.getIndex | ( |  | ) | throws com.foxit.sdk.PDFException

Get the index of current annotation in the page which current annotation belongs to.

Returns
  The index value, starting from 0.

## ◆ getModifiedDateTime()

DateTime com.foxit.sdk.pdf.annots.Annot.getModifiedDateTime | ( |  | ) | throws com.foxit.sdk.PDFException

Get last modified date time.

Returns
  A date and time object that receives the last modified date time. If there is no modified date time information, a date and time object with all 0 values would be returned.

## ◆ getOptionalContent()

PDFDictionary com.foxit.sdk.pdf.annots.Annot.getOptionalContent | ( |  | ) | throws com.foxit.sdk.PDFException

Get the PDF dictionary of annotation's optional content.

Returns
  The PDF dictionary of annotation's optional content. If there is no "OC" entry or any error occurs, this function will return null.

## ◆ getPage()

PDFPage com.foxit.sdk.pdf.annots.Annot.getPage | ( |  | ) | throws com.foxit.sdk.PDFException

Get the related PDF page.

Returns
  A PDF page object which is the related PDF page.

## ◆ getRect()

RectF com.foxit.sdk.pdf.annots.Annot.getRect | ( |  | ) | throws com.foxit.sdk.PDFException

Get rectangle, in PDF coordinate system.

Returns
  The annotation rectangle. If there is no rectangle information, a RectF object with all 0 values would be returned.

## ◆ getType()

int com.foxit.sdk.pdf.annots.Annot.getType | ( |  | ) | throws com.foxit.sdk.PDFException

Get actual annotation type of current annotation.

Returns
  Annotation type. Please refer to values starting from com.foxit.sdk.pdf.annots.Annot.e_Note and this would be one of these values.

## ◆ getUniqueID()

String com.foxit.sdk.pdf.annots.Annot.getUniqueID | ( |  | ) | throws com.foxit.sdk.PDFException

Get unique ID.

Returns
  Unique ID string.

## ◆ hasProperty()

boolean com.foxit.sdk.pdf.annots.Annot.hasProperty | ( | int | property | ) | throws com.foxit.sdk.PDFException

Whether current annotation has the specified annotation's property.

Parameters

  [in] | property | Property name. Please refer to values starting from com.foxit.sdk.pdf.annots.Annot.e_PropertyModifiedDate and this should be one of these values.

Returns
  true means current annotation has the specified property, while false means current annotation does not have the specified property.

## ◆ isEmpty()

boolean com.foxit.sdk.pdf.annots.Annot.isEmpty | ( |  | ) |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ isMarkup()

boolean com.foxit.sdk.pdf.annots.Annot.isMarkup | ( |  | ) | throws com.foxit.sdk.PDFException

Check if current annotation is a markup annotation.

Returns
  true means current annotation is a markup annotation, while false means current annotation is not a markup annotation.

## ◆ move() [1/2]

boolean com.foxit.sdk.pdf.annots.Annot.move | ( | RectF | rect | ) | throws com.foxit.sdk.PDFException

Move current annotation to a new position, specified by a new rectangle in PDF coordinate system.

Parameters

  [in] | rect | New rectangle to specify the new position where current annotation is to be moved to. It should be valid in [PDF coordinate system] (com.foxit.sdk.pdf.PDFPage).

Returns
  true means success, while false means failure.

## ◆ move() [2/2]

boolean com.foxit.sdk.pdf.annots.Annot.move | ( | RectF | rect,
|  | boolean | is_reset_appearance
| ) |  | throws com.foxit.sdk.PDFException

Move current annotation to a new position, specified by a new rectangle in PDF coordinate system.

Parameters

  [in] | rect | New rectangle to specify the new position where current annotation is to be moved to. It should be valid in [PDF coordinate system] (com.foxit.sdk.pdf.PDFPage).
  [in] | is_reset_appearance | A boolean value specifies whether to reset annotation's appearance after moving.

Returns
  true means success, while false means failure.

## ◆ removeProperty()

boolean com.foxit.sdk.pdf.annots.Annot.removeProperty | ( | int | property | ) | throws com.foxit.sdk.PDFException

Remove a specified annotation's property.

This function can be used to remove some optional properties of an annotation. When appearance related property is removed successfully, such as com.foxit.sdk.pdf.annots.Annot.e_PropertyBorderColor and com.foxit.sdk.pdf.annots.Annot.e_PropertyFillColor , user should call function Annot.resetAppearanceStream to make effect on annotation's appearance.

Parameters

  [in] | property | Property name. Please refer to values starting from com.foxit.sdk.pdf.annots.Annot.e_PropertyModifiedDate and this should be one of these values.

Returns
  true means remove the specified property successfully, or current annotation supports the property but does not have the property.
  false means current annotation does not support to have the specified property, or current annotation cannot be removed specified property.

## ◆ resetAppearanceStream() [1/2]

boolean com.foxit.sdk.pdf.annots.Annot.resetAppearanceStream | ( |  | ) | throws com.foxit.sdk.PDFException

Reset appearance stream.

Annotation's appearance is stored as stream in PDF document. Any appearance-related property can be changed through the corresponding setting functions. For this change to take effect, this function should be called to update the annotation's appearance.
Please check "Note" part in the comment of class Annot to see which types of annotations can be reset appearance by current function and also check comment in classes of these annotations to see if any property is required before resetting appearance stream.

Returns
  true means success, while false means failure.

## ◆ resetAppearanceStream() [2/2]

boolean com.foxit.sdk.pdf.annots.Annot.resetAppearanceStream | ( | boolean | is_generate_new_appearance_obj | ) | throws com.foxit.sdk.PDFException

Reset appearance stream.

Annotation's appearance is stored as stream in PDF document. Any appearance-related property can be changed through the corresponding setting functions. For this change to take effect, this function should be called to update the annotation's appearance.
Please check "Note" part in the comment of class Annot to see which types of annotations can be reset appearance by current function and also check comment in classes of these annotations to see if any property is required before resetting appearance stream.

Parameters

  [in] | is_generate_new_appearance_obj | true means to generate a new appearance object to reset the appearance of the current annotation, while false means to reset the appearance of annotations that share this appearance stream. The parameter has only effect on widget annotation's appearance.

Returns
  true means success, while false means failure.

## ◆ setBorderColor()

void com.foxit.sdk.pdf.annots.Annot.setBorderColor | ( | long | color | ) | throws com.foxit.sdk.PDFException

Set border color.

This property has effect on annotation's appearance. If user wants the new border color has effect on annotation's appearance, please call function Annot.resetAppearanceStream after setting the new border color.

Parameters

  [in] | color | New border color to be set. Format: 0xRRGGBB.

Returns
  None.

## ◆ setBorderInfo()

void com.foxit.sdk.pdf.annots.Annot.setBorderInfo | ( | BorderInfo | border | ) | throws com.foxit.sdk.PDFException

Set border information.

This property has effect on annotation's appearance. If user wants the new border information has effect on annotation's appearance, please call function Annot.resetAppearanceStream after setting the new border information.
Attention: among supported annotation types (please refer to "Note" comment part of class Annot ), this property will not have effect on appearance of these annotations: note, highlight, underline, strikeout, squiggly, stamp, caret, popup, file attachment, PSInk, redact. For ink annotation, only border width will have effect on ink annotation's appearance.

Parameters

  [in] | border | New border information to be set. It should be a valid border information object. If any value of parameter border is invalid, this function will fail to set new border information to current annotation.

Returns
  None.

## ◆ setContent()

void com.foxit.sdk.pdf.annots.Annot.setContent | ( | String | content | ) | throws com.foxit.sdk.PDFException

Set content.

For free text annotation and line annotation (which has enabled caption), they would show content in their appearance. So for these kinds of annotations, this property would have effect on annotation's appearance. If user wants the effect to be shown in the appearance of these kind of annotations, please call function Annot.resetAppearanceStream after setting new content.

Parameters

  [in] | content | New content string to be set.

Returns
  None.

## ◆ setFlags()

void com.foxit.sdk.pdf.annots.Annot.setFlags | ( | int | flags | ) | throws com.foxit.sdk.PDFException

Set annotation flags.

Parameters

  [in] | flags | The annotation flags. It could be 0, or one or a combination of values starting from com.foxit.sdk.pdf.annots.Annot.e_FlagInvisible .

Returns
  None.

## ◆ setModifiedDateTime()

void com.foxit.sdk.pdf.annots.Annot.setModifiedDateTime | ( | DateTime | date_time | ) | throws com.foxit.sdk.PDFException

Set last modified date time.

Parameters

  [in] | date_time | The data time to be set. It should contain valid date time data.

Returns
  None.

## ◆ setUniqueID()

void com.foxit.sdk.pdf.annots.Annot.setUniqueID | ( | String | unique_id | ) | throws com.foxit.sdk.PDFException

Set unique ID.

Parameters

  [in] | unique_id | New unique ID string to be set.

Returns
  None.

## Member Data Documentation

## ◆ e_FlagHidden

final int com.foxit.sdk.pdf.annots.Annot.e_FlagHidden = 0x0002
| static

Annotation flag: hidden.

If set, do not display or print the annotation or allow it to interact with the user, regardless of its annotation type or whether an annotation handler is available.

## ◆ e_FlagInvisible

final int com.foxit.sdk.pdf.annots.Annot.e_FlagInvisible = 0x0001
| static

Annotation flag: invisible.

If set, do not display the annotation if it does not belong to one of the standard annotation types and no annotation handler is available. If clear, display such an non-standard annotation using an appearance stream specified by its appearance dictionary, if any.

## ◆ e_FlagLocked

final int com.foxit.sdk.pdf.annots.Annot.e_FlagLocked = 0x0080
| static

Annotation flag: locked.

If set, do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.

## ◆ e_FlagLockedContents

final int com.foxit.sdk.pdf.annots.Annot.e_FlagLockedContents = 0x0200
| static

Annotation flag: locked contents.

If set, do not allow the contents of the annotation to be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.

## ◆ e_FlagNoRotate

final int com.foxit.sdk.pdf.annots.Annot.e_FlagNoRotate = 0x0010
| static

Annotation flag: no rotate.

If set, do not rotate the annotation's appearance to match the rotation of the page. The upper-left corner of the annotation rectangle remains in a fixed location on the page, regardless of the page rotation.

## ◆ e_FlagNoView

final int com.foxit.sdk.pdf.annots.Annot.e_FlagNoView = 0x0020
| static

Annotation flag: no view.

If set, do not display the annotation on the screen or allow it to interact with the user. The annotation may be printed (depending on the setting of flag com.foxit.sdk.pdf.annots.Annot.e_FlagPrint ) but should be considered hidden for purposes of on-screen display and user interaction.

## ◆ e_FlagNoZoom

final int com.foxit.sdk.pdf.annots.Annot.e_FlagNoZoom = 0x0008
| static

Annotation flag: no zoom.

If set, do not scale the annotation's appearance to match the magnification of the page. The location of the annotation on the page (defined by the upper-left corner of its annotation rectangle) remains fixed, regardless of the page magnification.

## ◆ e_FlagPrint

final int com.foxit.sdk.pdf.annots.Annot.e_FlagPrint = 0x0004
| static

Annotation flag: print.

If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of whether it is displayed on the screen. This can be useful, for example, for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page.

## ◆ e_FlagReadOnly

final int com.foxit.sdk.pdf.annots.Annot.e_FlagReadOnly = 0x0040
| static

Annotation flag: read only.

If set, do not allow the annotation to interact with the user. The annotation may be displayed or printed (depending on the settings of flags com.foxit.sdk.pdf.annots.Annot.e_FlagNoView and com.foxit.sdk.pdf.annots.Annot.e_FlagPrint ) but should not respond to mouse clicks or change its appearance in response to mouse motions.

Note
  This flag is ignored for widget annotations; its function is subsumed by flag com.foxit.sdk.pdf.interform.Field.e_FlagReadOnly of related form field.

## ◆ e_FlagToggleNoView

final int com.foxit.sdk.pdf.annots.Annot.e_FlagToggleNoView = 0x0100
| static

Annotation flag: toggle no view.

If set, invert the interpretation of the NoView flag for certain events. A typical use is to have an annotation that appears only when a mouse cursor is held over it.

## ◆ e_MKEntryDownCaption

final int com.foxit.sdk.pdf.annots.Annot.e_MKEntryDownCaption = 5
| static

Down caption (or alternate caption) entry. "AC" in MK dictionary.

Note
  Only applicable for widget annotation associated with pushbutton field.

## ◆ e_MKEntryDownIcon

final int com.foxit.sdk.pdf.annots.Annot.e_MKEntryDownIcon = 8
| static

Down icon (or alternate icon) entry. "IX" in MK dictionary.

Note
  Only applicable for widget annotation associated with pushbutton field.

## ◆ e_MKEntryIconCaptionRelation

final int com.foxit.sdk.pdf.annots.Annot.e_MKEntryIconCaptionRelation = 10
| static

Icon and caption relation entry. "TP" in MK dictionary.

Note
  Only applicable for widget annotation associated with pushbutton field. This is used to specify where to position the text of widget annotation's mk caption relative to widget annotation's mk icon.

## ◆ e_MKEntryIconFit

final int com.foxit.sdk.pdf.annots.Annot.e_MKEntryIconFit = 9
| static

Icon fit information entry. "IF" in MK dictionary.

Note
  Only applicable for widget annotation associated with pushbutton field.

## ◆ e_MKEntryNormalCaption

final int com.foxit.sdk.pdf.annots.Annot.e_MKEntryNormalCaption = 3
| static

Normal caption entry. "CA" in MK dictionary.

Note
  Only applicable for widget annotation associated with pushbutton field, check box field or radio button field.

## ◆ e_MKEntryNormalIcon

final int com.foxit.sdk.pdf.annots.Annot.e_MKEntryNormalIcon = 6
| static

Normal icon entry. "I" in MK dictionary.

Note
  Only applicable for widget annotation associated with pushbutton field.

## ◆ e_MKEntryRolloverCaption

final int com.foxit.sdk.pdf.annots.Annot.e_MKEntryRolloverCaption = 4
| static

Rollover caption entry. "RC" in MK dictionary.

Note
  Only applicable for widget annotation associated with pushbutton field.

## ◆ e_MKEntryRolloverIcon

final int com.foxit.sdk.pdf.annots.Annot.e_MKEntryRolloverIcon = 7
| static

Rollover icon entry. "RI" in MK dictionary.

Note
  Only applicable for widget annotation associated with pushbutton field.

## ◆ e_PropertyBorderColor

final int com.foxit.sdk.pdf.annots.Annot.e_PropertyBorderColor = 2
| static

Annotation property: border color.

Free text annotation can have border color property but not support to remove this property from free text annotation.

## ◆ e_PropertyCreationDate

final int com.foxit.sdk.pdf.annots.Annot.e_PropertyCreationDate = 1
| static

Annotation property: creation date.

Only markup annotations can have creation date property.

## ◆ e_PropertyFillColor

final int com.foxit.sdk.pdf.annots.Annot.e_PropertyFillColor = 3
| static

Annotation property: fill color.

Only following types of annotations can have fill color property:
square, circle, free text, line, polygon, polyline, redact.

## ◆ e_Widget

final int com.foxit.sdk.pdf.annots.Annot.e_Widget = 20
| static

Annotation type: widget annotation. One of standard annotation in <PDF reference 1.7>.

Note
  Foxit PDF SDK treats widget annotation as form control.