Summary: Nested Classes | Constants | Ctors | Methods | Inherited Methods | [Expand All]
public class

# Annot

extends Object

java.lang.Object
↳ | com.pdftron.pdf.Annot

Known Direct Subclasses Link, Markup, Movie, Popup, Screen, Watermark, Widget
Link | A link annotation represents either a hypertext link to a destination elsewhere in the document or an action to be performed.
Markup | The meaning of an annotation's Contents entry varies by annotation type.
Movie | The Class Movie.
Popup | A pop-up annotation (PDF 1.3) displays text in a pop-up window for entry and editing.
Screen | A screen annotation (PDF 1.5) specifies a region of a page upon which media clips may be played.
Watermark | A watermark annotation (PDF 1.6) shall be used to represent graphics that shall be printed at a fixed size and position on a page, regardless of the dimensions of the printed page.
Widget | Interactive forms use widget annotations (PDF 1.2) to represent the appearance of fields and to manage user interactions.

Known Indirect Subclasses Caret, CheckBoxWidget, Circle, ComboBoxWidget, FileAttachment, FreeText, Highlight, Ink, Line, ListBoxWidget, PolyLine, Polygon, PushButtonWidget, RadioButtonWidget, Redaction, and 10 others.
Caret | A Caret annotation (PDF 1.5) is a visual symbol that indicates the presence of text edits.
CheckBoxWidget | An object representing a check box used in a PDF Form.
Circle | Square and circle annotations (PDF 1.3) shall display, respectively, a rectangle or an ellipse on the page.
ComboBoxWidget | An object representing a Combo Box used in a PDF Form.
FileAttachment | A file attachment annotation (PDF 1.3) contains a reference to a file, which typically shall be embedded in the PDF file.
FreeText | A free text annotation (PDF 1.3) displays text directly on the page.
Highlight | Text markup annotations shall appear as highlights, underlines, strikeouts (all PDF 1.3), or jagged ("squiggly") underlines (PDF 1.4) in the text of a document.
Ink | An ink annotation (PDF 1.3) represents a freehand "scribble" composed of one or more disjoint paths.
Line | The purpose of a line annotation (PDF 1.3) is to display a single straight line on the page.
ListBoxWidget | An object representing a List Box used in a PDF Form.
PolyLine | Polyline annotations (PDF 1.5) display (open or closed) shapes of multiple edges on the page.
Polygon | The Polygon class.
PushButtonWidget | An object representing a push button used in a PDF Form.
RadioButtonWidget | An object representing a Radio Button used in a PDF Form.
Redaction | A redaction annotation (PDF 1.7) identifies content that is intended to be removed from the document.
RubberStamp | A rubber stamp annotation (PDF 1.3) displays text or graphics intended to look as if they were stamped on the page with a rubber stamp.
SignatureWidget | An object representing a Signature used in a PDF Form.
Sound | A sound annotation (PDF 1.2) shall analogous to a text annotation except that instead of a text note, it contains sound recorded from the computer's microphone or imported from a file.
Square | Square and circle annotations (PDF 1.3) shall display, respectively, a rectangle or an ellipse on the page.
Squiggly | TextMarkup annotations shall appear as highlights, underlines, strikeouts (all PDF 1.3), or jagged ("squiggly") underlines (PDF 1.4) in the text of a document.
StrikeOut | TextMarkup annotations shall appear as highlights, underlines, strikeouts (all PDF 1.3), or jagged ("squiggly") underlines (PDF 1.4) in the text of a document.
Text | A text annotation represents a "sticky note" attached to a point in the PDF document.
TextMarkup | Text markup annotations shall appear as highlights, underlines, strikeouts (all PDF 1.3), or jagged ("squiggly") underlines (PDF 1.4) in the text of a document.
TextWidget | An object representing a Text Box used in a PDF Form.
Underline | Text markup annotations shall appear as highlights, underlines, strikeouts (all PDF 1.3), or jagged ("squiggly") underlines (PDF 1.4) in the text of a document.

## Class Overview

Annot is a base class for different types of annotations. For annotation specific properties, please refer to derived classes. An annotation is an interactive object placed on a page, such as a text note, a link, or an embedded file. PDF includes a wide variety of standard annotation types. An annotation associates an object such as a widget, note, or movie with a location on a page of a PDF document, or provides a means of interacting with the user via the mouse and keyboard. For more details on PDF annotations please refer to section 12.5 in the PDF Reference Manual and the

## Summary

Nested Classes
class | Annot.BorderStyle | BorderStyle structure specifies the characteristics of the annotation's border.

Constants
int | e_3D | The Constant e_3D.
int | e_Caret | The Constant e_Caret.
int | e_Circle | The Constant e_Circle.
int | e_FileAttachment | The Constant e_FileAttachment.
int | e_FreeText | The Constant e_FreeText.
int | e_Highlight | The Constant e_Highlight.
int | e_Ink | The Constant e_Ink.
int | e_Line | The Constant e_Line.
int | e_Link | The Constant e_Link.
int | e_Movie | The Constant e_Movie.
int | e_Polygon | The Constant e_Polygon.
int | e_Polyline | The Constant e_Polyline.
int | e_Popup | The Constant e_Popup.
int | e_PrinterMark | The Constant e_PrinterMark.
int | e_Projection | The Constant e_Projection.
int | e_Redact | The Constant e_Redact.
int | e_RichMedia | The Constant e_RichMedia.
int | e_Screen | The Constant e_Screen.
int | e_Sound | The Constant e_Sound.
int | e_Square | The Constant e_Square.
int | e_Squiggly | The Constant e_Squiggly.
int | e_Stamp | The Constant e_Stamp.
int | e_StrikeOut | The Constant e_StrikeOut.
int | e_Text | PDF supports the standard annotation types listed in the following enumeration (plug-in extensions may add new annotation types):.
int | e_TrapNet | The Constant e_TrapNet.
int | e_Underline | The Constant e_Underline.
int | e_Unknown | The Constant e_Unknown.
int | e_Watermark | The Constant e_Watermark.
int | e_Widget | The Constant e_Widget.
int | e_action_trigger_activate | Triggered when the annotation is activated.
int | e_action_trigger_annot_blur | Triggered when the annotation loses the input focus
int | e_action_trigger_annot_down | Triggered when the mouse button is pressed inside the annotation's active area
int | e_action_trigger_annot_enter | Triggered when the cursor enters the annotation's active area
int | e_action_trigger_annot_exit | Triggered when the cursor exits the annotation's active area
int | e_action_trigger_annot_focus | Triggered when the annotation receives the input focus
int | e_action_trigger_annot_page_close | Triggered when the page containing the annotation is closed
int | e_action_trigger_annot_page_invisible | Triggered when the page containing the annotation is no longer visible in the interactive PDF processor's user interface
int | e_action_trigger_annot_page_open | Triggered when the page containing the annotation is opened
int | e_action_trigger_annot_page_visible | Triggered when the page containing the annotation becomes visible
int | e_action_trigger_annot_up | Triggered when the mouse button is released inside the annotation's active area
int | e_down | The Constant e_down.
int | e_hidden | The Constant e_hidden.
int | e_invisible | Flags specifying various characteristics of the annotation.
int | e_locked | The Constant e_locked.
int | e_locked_contents | The Constant e_locked_contents.
int | e_no_rotate | The Constant e_no_rotate.
int | e_no_view | The Constant e_no_view.
int | e_no_zoom | The Constant e_no_zoom.
int | e_normal | An annotation can define as many as three separate appearances: The normal appearance is used when the annotation is not interacting with the user.
int | e_print | The Constant e_print.
int | e_read_only | The Constant e_read_only.
int | e_rollover | The Constant e_rollover.
int | e_toggle_no_view | The Constant e_toggle_no_view.

Public Constructors
| Annot(Obj d) Create an annotation and initialize it using given Cos/SDF object.
| Annot() Create an empty annotation.

Public Methods
int | GetStructParent() Get the struct parent of an annotation.
static Annot | __Create(long impl, Object ref)
long | __GetHandle()
Object | __GetRefHandle()
static Annot | create(Doc doc, int type, Rect pos) Creates a new annotation of a given type, in the specified document.
void | deleteCustomData(String key) Deletes custom data associated with the given key.
boolean | equals(Object d) Compares two annotations for equality.
void | flatten(Page page) Flatten/Merge the existing annotation appearances with the page content and delete this annotation from a given page.
String | getActiveAppearanceState() Get the annotation's active appearance state.
Obj | getAppearance(int annot_state, String app_state) Get the annotation's appearance for the given combination of annotation and appearance states.
Obj | getAppearance() Get the annotation's appearance for the given combination of annotation and appearance states.
Obj | getAppearance(int annot_state) Get the annotation's appearance for the given combination of annotation and appearance states.
Annot.BorderStyle | getBorderStyle() Get the border style for the annotation.
ColorPt | getColorAsCMYK() Get an annotation's color.
ColorPt | getColorAsGray() Get an annotation's color.
ColorPt | getColorAsRGB() Get an annotation's color.
int | getColorCompNum() Get the color space the annotation's color is represented in.
String | getContents() Get the annotation contents.
String | getCustomData(String key) Returns custom data associated with the given key.
Date | getDate() Gets an annotation's last modified date.
boolean | getFlag(int flag) Determine if the give flag is marked flagged
Obj | getOptionalContent() Get optional content of an annotation.
Page | getPage() Get the page the annotation is associated with.
Rect | getRect() Get annoation bound rectangle
int | getRotation() Get the rotation value of the annotation.
Obj | getSDFObj() Get the SDFObj.
Obj | getTriggerAction(int trigger) Get the Action associated with the selected Annot Trigger event.
int | getType() Get the annotation type.
Obj | getUniqueID() Get the annotiation unique ID.
Rect | getVisibleContentBox() It is possible during viewing that GetRect does not return the most accurate bounding box of what is actually rendered.
int | hashCode()
boolean | isMarkup() Checks if annoation is markup.
boolean | isValid() Checks if Annot is valid.
void | refreshAppearance() Regenerates the appearance stream for the annotation.
void | refreshAppearance(RefreshOptions opts) A version of RefreshAppearance allowing custom options to make slight tweaks in behaviour.
void | removeAppearance() Removes the annotation's default appearance.
void | removeAppearance(int annot_state, String app_state) Removes the annotation's appearance for the given combination of annotation and appearance states.
void | resize(Rect pos) Resize annotation
void | setActiveAppearanceState(String astate) Set the annotation's active appearance state.
void | setAppearance(Obj app_stream, int annot_state) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setAppearance(Obj app_stream) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setAppearance(Obj app_stream, int annot_state, String app_state) Set the annotation's appearance for the given combination of annotation and appearance states.
void | setBorderStyle(Annot.BorderStyle bs) Set the border style for the annotation.
void | setColor(ColorPt cpt) Set an annotation's color.
void | setColor(ColorPt cpt, int comp_num) Set an annotation's color.
void | setContents(String ct) Set annotation contents.
void | setCustomData(String key, String value) Sets the custom data associated with the specified key.
void | setDate(Date date) Sets an annotation's last modified date.
void | setDateToNow() Sets an annotation's last modified date to the current time.
void | setFlag(int flag, boolean value) Set the value of given Flag.
void | setOptionalContent(Obj oc) Set optional content of an annotation.
void | setPage(Page page) Set the reference to a page the annotation is associated with.
void | setRect(Rect pos) Set the size and location of an annotation on its page.
void | setRotation(int rot) Set the rotation value of the annotation.
void | setStructParent(int keyval) Set the struct parent of an annotation.
void | setUniqueID(String icon_name) Set the unique identifier for this annotation.

[Expand] Inherited Methods
From class java.lang.Object
boolean | equals(Object arg0)
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Constants

#### public static final int e_3D

The Constant e_3D.

Constant Value: 24 (0x00000018)

#### public static final int e_Caret

The Constant e_Caret.

Constant Value: 13 (0x0000000d)

#### public static final int e_Circle

The Constant e_Circle.

Constant Value: 5 (0x00000005)

#### public static final int e_FileAttachment

The Constant e_FileAttachment.

Constant Value: 16 (0x00000010)

#### public static final int e_FreeText

The Constant e_FreeText.

Constant Value: 2 (0x00000002)

#### public static final int e_Highlight

The Constant e_Highlight.

Constant Value: 8 (0x00000008)

#### public static final int e_Ink

The Constant e_Ink.

Constant Value: 14 (0x0000000e)

#### public static final int e_Line

The Constant e_Line.

Constant Value: 3 (0x00000003)

#### public static final int e_Link

The Constant e_Link.

Constant Value: 1 (0x00000001)

#### public static final int e_Movie

The Constant e_Movie.

Constant Value: 18 (0x00000012)

#### public static final int e_Polygon

The Constant e_Polygon.

Constant Value: 6 (0x00000006)

#### public static final int e_Polyline

The Constant e_Polyline.

Constant Value: 7 (0x00000007)

#### public static final int e_Popup

The Constant e_Popup.

Constant Value: 15 (0x0000000f)

#### public static final int e_PrinterMark

The Constant e_PrinterMark.

Constant Value: 21 (0x00000015)

#### public static final int e_Projection

The Constant e_Projection.

Constant Value: 26 (0x0000001a)

#### public static final int e_Redact

The Constant e_Redact.

Constant Value: 25 (0x00000019)

#### public static final int e_RichMedia

The Constant e_RichMedia.

Constant Value: 27 (0x0000001b)

#### public static final int e_Screen

The Constant e_Screen.

Constant Value: 20 (0x00000014)

#### public static final int e_Sound

The Constant e_Sound.

Constant Value: 17 (0x00000011)

#### public static final int e_Square

The Constant e_Square.

Constant Value: 4 (0x00000004)

#### public static final int e_Squiggly

The Constant e_Squiggly.

Constant Value: 10 (0x0000000a)

#### public static final int e_Stamp

The Constant e_Stamp.

Constant Value: 12 (0x0000000c)

#### public static final int e_StrikeOut

The Constant e_StrikeOut.

Constant Value: 11 (0x0000000b)

#### public static final int e_Text

PDF supports the standard annotation types listed in the following enumeration (plug-in extensions may add new annotation types):.

Constant Value: 0 (0x00000000)

#### public static final int e_TrapNet

The Constant e_TrapNet.

Constant Value: 22 (0x00000016)

#### public static final int e_Underline

The Constant e_Underline.

Constant Value: 9 (0x00000009)

#### public static final int e_Unknown

The Constant e_Unknown.

Constant Value: 28 (0x0000001c)

#### public static final int e_Watermark

The Constant e_Watermark.

Constant Value: 23 (0x00000017)

#### public static final int e_Widget

The Constant e_Widget.

Constant Value: 19 (0x00000013)

#### public static final int e_action_trigger_activate

Triggered when the annotation is activated. if present, takes precedence over U entry (e_action_trigger_annot_up)

Constant Value: 0 (0x00000000)

#### public static final int e_action_trigger_annot_blur

Triggered when the annotation loses the input focus

Constant Value: 6 (0x00000006)

#### public static final int e_action_trigger_annot_down

Triggered when the mouse button is pressed inside the annotation's active area

Constant Value: 3 (0x00000003)

#### public static final int e_action_trigger_annot_enter

Triggered when the cursor enters the annotation's active area

Constant Value: 1 (0x00000001)

#### public static final int e_action_trigger_annot_exit

Triggered when the cursor exits the annotation's active area

Constant Value: 2 (0x00000002)

#### public static final int e_action_trigger_annot_focus

Triggered when the annotation receives the input focus

Constant Value: 5 (0x00000005)

#### public static final int e_action_trigger_annot_page_close

Triggered when the page containing the annotation is closed

Constant Value: 8 (0x00000008)

#### public static final int e_action_trigger_annot_page_invisible

Triggered when the page containing the annotation is no longer visible in the interactive PDF processor's user interface

Constant Value: 10 (0x0000000a)

#### public static final int e_action_trigger_annot_page_open

Triggered when the page containing the annotation is opened

Constant Value: 7 (0x00000007)

#### public static final int e_action_trigger_annot_page_visible

Triggered when the page containing the annotation becomes visible

Constant Value: 9 (0x00000009)

#### public static final int e_action_trigger_annot_up

Triggered when the mouse button is released inside the annotation's active area

Constant Value: 4 (0x00000004)

#### public static final int e_down

The Constant e_down.

Constant Value: 2 (0x00000002)

#### public static final int e_hidden

The Constant e_hidden.

Constant Value: 1 (0x00000001)

#### public static final int e_invisible

Flags specifying various characteristics of the annotation. - If e_invisible is 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 unknown annotation using an appearance stream specified by its appearance dictionary, if any. - If e_hidden is 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. - If e_print is 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. - If e_no_zoom is set, do not scale the annotation's appearance to match the magnification of the page. - If e_no_rotate is set, do not rotate the annotation's appearance to match the rotation of the page. - If e_no_view is 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 the Print flag) but should be considered hidden for purposes of on-screen display and user interaction. - If e_read_only is set, do not allow the annotation to interact with the user. The annotation may be displayed or printed (depending on the settings of the NoView and Print flags) but should not respond to mouse clicks or change its appearance in response to mouse motions. - If e_locked is 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. - If e_toggle_no_view is 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. - If e_locked_contents is 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.

Constant Value: 0 (0x00000000)

#### public static final int e_locked

The Constant e_locked.

Constant Value: 7 (0x00000007)

#### public static final int e_locked_contents

The Constant e_locked_contents.

Constant Value: 9 (0x00000009)

#### public static final int e_no_rotate

The Constant e_no_rotate.

Constant Value: 4 (0x00000004)

#### public static final int e_no_view

The Constant e_no_view.

Constant Value: 5 (0x00000005)

#### public static final int e_no_zoom

The Constant e_no_zoom.

Constant Value: 3 (0x00000003)

#### public static final int e_normal

An annotation can define as many as three separate appearances: The normal appearance is used when the annotation is not interacting with the user. This appearance is also used for printing the annotation. The rollover appearance is used when the user moves the cursor into the annotation's active area without pressing the mouse button. The down appearance is used when the mouse button is pressed or held down within the annotation's active area.

Constant Value: 0 (0x00000000)

#### public static final int e_print

The Constant e_print.

Constant Value: 2 (0x00000002)

#### public static final int e_read_only

The Constant e_read_only.

Constant Value: 6 (0x00000006)

#### public static final int e_rollover

The Constant e_rollover.

Constant Value: 1 (0x00000001)

#### public static final int e_toggle_no_view

The Constant e_toggle_no_view.

Constant Value: 8 (0x00000008)

## Public Constructors

#### public Annot (Obj d)

Create an annotation and initialize it using given Cos/SDF object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

##### Parameters

d | the d

#### public Annot ()

Create an empty annotation.

## Public Methods

#### public int GetStructParent ()

Get the struct parent of an annotation. (Required if the annotation is a structural content item; PDF'1.3)

Note: The StructParent is the integer key of the annotation's entry in the structural parent tree.

##### Returns

- An integer which is the integer key of the annotation's entry in the structural parent tree.

##### Throws

PDFNetException |

#### public static Annot __Create (long impl, Object ref)

#### public long __GetHandle ()

#### public Object __GetRefHandle ()

#### public static Annot create (Doc doc, int type, Rect pos)

Creates a new annotation of a given type, in the specified document. Because the newly created annotation does not contain any properties specific to a given annotation type, it is faster to create an annotation using type specific Annot.Create method.

##### Parameters

doc | A document to which the annotation is added.
type | Subtype of annotation to create.
pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.

##### Returns

- A newly created blank annotation for the given annotation type.

##### Throws

PDFNetException |

#### public void deleteCustomData (String key)

Deletes custom data associated with the given key.

##### Parameters

key | The key for which to delete the associated data.

##### Throws

PDFNetException |

#### public boolean equals (Object d)

Compares two annotations for equality. The comparison will return true only if both annotations share the same underlying SDF/Cos object.

##### Parameters

d | the other annotation

##### Returns

- true, if successful

#### public void flatten (Page page)

Flatten/Merge the existing annotation appearances with the page content and delete this annotation from a given page. Annotation 'flattening' refers to the operation that changes active annotations (such as markup, widgets, 3D models, etc.) into a static area that is part of the PDF document, just like the other text and images in the document.

Note: an alternative approach to set the annotation as read only is using Annot.SetFlag(Annot::e_read_only, true) method. Unlike Annot.SetFlag(...), the result of Flatten() operation can not be programatically reversed.

##### Parameters

page | the page

##### Throws

PDFNetException |

#### public String getActiveAppearanceState ()

Get the annotation's active appearance state.

##### Returns

- the name of the active state. The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.

##### Throws

PDFNetException |

#### public Obj getAppearance (int annot_state, String app_state)

Get the annotation's appearance for the given combination of annotation and appearance states.

##### Parameters

annot_state | The annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
app_state | Is an optional parameter specifying the appearance state to look for (e.g. "Off", "On", etc). If appearance_state is NULL, the choice between different appearance states is determined by the AS (Appearance State) entry in the annotation dictionary.

##### Returns

- The appearance stream for this annotation, or NULL if the annotation does not have an appearance for the given combination of annotation and appearance states.

##### Throws

PDFNetException |

#### public Obj getAppearance ()

Get the annotation's appearance for the given combination of annotation and appearance states.

##### Returns

- The appearance stream for this annotation, or NULL if the annotation does not have an appearance for the given combination of annotation and appearance states.

##### Throws

PDFNetException |

#### public Obj getAppearance (int annot_state)

Get the annotation's appearance for the given combination of annotation and appearance states.

##### Parameters

annot_state | The annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.

##### Returns

- the appearance

##### Throws

PDFNetException |

#### public Annot.BorderStyle getBorderStyle ()

Get the border style for the annotation. Typically used for Link annotations.

##### Returns

- Annotation's border style.

##### Throws

PDFNetException |

#### public ColorPt getColorAsCMYK ()

Get an annotation's color.

##### Returns

- A ColorPt object containing an array of four numbers in the range 0.0 to 1.0, representing a CMYK colour used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.

##### Throws

PDFNetException |

#### public ColorPt getColorAsGray ()

Get an annotation's color.

##### Returns

- A ColorPt object containing a number in the range 0.0 to 1.0, representing a Gray Scale colour used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.

##### Throws

PDFNetException |

#### public ColorPt getColorAsRGB ()

Get an annotation's color.

##### Returns

- A ColorPt object containing an array of three numbers in the range 0.0 to 1.0, representing an RGB colour used for the following purposes: The background of the annotation's icon when closed The title bar of the annotation's pop-up window The border of a link annotation If the annotation does not specify an explicit color, a default color is returned. Text annotations return 'default yellow;' all others return black.

##### Throws

PDFNetException |

#### public int getColorCompNum ()

Get the color space the annotation's color is represented in.

##### Returns

- An integer that is either 1(for DeviceGray), 3(DeviceRGB), or 4(DeviceCMYK). If the annotation has no color, i.e. is transparent, 0 will be returned.

##### Throws

PDFNetException |

#### public String getContents ()

Get the annotation contents.

##### Returns

- contents from annotation

##### Throws

PDFNetException |

#### public String getCustomData (String key)

Returns custom data associated with the given key.

##### Parameters

key | The key for which to retrieve the associated data.

##### Returns

- the custom data string. If no data is available an empty string is returned.

##### Throws

PDFNetException |

#### public Date getDate ()

Gets an annotation's last modified date.

##### Returns

- The annotation's last modified time and date. If the annotation has no associated date structure, the returned date is not valid (date.IsValid() returns false). Corresponds to the "M" entry of the annotation dictionary.

##### Throws

PDFNetException |

#### public boolean getFlag (int flag)

Determine if the give flag is marked flagged

##### Parameters

flag | The Flag property to query.

##### Returns

- The value of given Flag

##### Throws

PDFNetException |

#### public Obj getOptionalContent ()

Get optional content of an annotation.

Note: The return value is an (optional content) group or (optional content) membership dictionary (PDF::OCG::OCMD)specifying the optional content properties for the annotation. Before the annotation is drawn, its visibility shall be determined based on this entry as well as the annotation flags specified in the Flag entry . If it is determined to be invisible, the annotation shall be skipped, as if it were not in the document.

##### Returns

- An SDF object corresponding to the grup of optional properties.

##### Throws

PDFNetException |

#### public Page getPage ()

Get the page the annotation is associated with.

##### Returns

- A Page object or NULL if the page reference is not available. The page object returned is an indirect reference to the page object with which this annotation is associated. This entry shall be present in screen annotations associated with rendition actions. Optional. PDF 1.3 PDF 1.4 PDF 1.5 not used in FDF files.

##### Throws

PDFNetException |

#### public Rect getRect ()

Get annoation bound rectangle

##### Returns

- Annotation's bounding rectangle, specified in user space coordinates. The meaning of the rectangle depends on the annotation type. For Link and RubberStamp annotations, the rectangle specifies the area containing the hyperlink area or stamp. For Note annotations, the rectangle is describing the popup window when it's opened. When it's closed, the icon is positioned at lower left corner.

##### Throws

PDFNetException |

#### public int getRotation ()

Get the rotation value of the annotation. The Rotation specifies the number of degrees by which the annotation shall be rotated counterclockwise relative to the page. The value shall be a multiple of 90.

Note: This property is part of the appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Returns

- An integer representing the rotation value of the annotation.

##### Throws

PDFNetException |

#### public Obj getSDFObj ()

Get the SDFObj.

##### Returns

- The underlying SDF/Cos object.

##### Throws

PDFNetException |

#### public Obj getTriggerAction (int trigger)

Get the Action associated with the selected Annot Trigger event.

##### Parameters

trigger | the type of trigger event to get

##### Returns

- The Action Obj if present, otherwise NULL

##### Throws

PDFNetException |

#### public int getType ()

Get the annotation type.

##### Returns

- The type of this annotation.

##### Throws

PDFNetException |

#### public Obj getUniqueID ()

Get the annotiation unique ID.

##### Returns

- The unique identifier for this annotation, or NULL if the identifier is not available. The returned value is a String object and is the value of the "NM" field, which was added as an optional attribute in PDF 1.4.

##### Throws

PDFNetException |

#### public Rect getVisibleContentBox ()

It is possible during viewing that GetRect does not return the most accurate bounding box of what is actually rendered. This method calculates the bounding box, rather than relying on what is specified in the PDF document. The bounding box is defined as the smallest rectangle that includes all the visible content on the annotation.

##### Returns

- the bounding box for this annotation. The dimensions are specified in user space coordinates.

##### Throws

PDFNetException |

#### public int hashCode ()

#### public boolean isMarkup ()

Checks if annoation is markup.

##### Returns

- true, if is markup

##### Throws

PDFNetException |

#### public boolean isValid ()

Checks if Annot is valid.

##### Returns

- True if this is a valid (non-null) annotation, false otherwise. If the function returns false the underlying SDF/Cos object is null or is not valid and the annotation object should be treated as a null object.

##### Throws

PDFNetException |

#### public void refreshAppearance ()

Regenerates the appearance stream for the annotation. This method can be used to auto-generate the annotation appearance after creating or modifying the annotation without providing an explicit appearance or setting the "NeedAppearances" flag in the AcroForm dictionary.

Note: If this annotation contains text, and has been added to a rotated page, the text in the annotation may be rotated. If RefreshAppearance is called *after* the annotation is added to a rotated page, then any text will be rotated in the opposite direction of the page rotation. If this method is called *before* the annotation is added to any rotated page, then no counter rotation will be applied. If you wish to call RefreshAppearance on an annotation already added to a rotated page, but you don't want the text to be rotated, you can do one of the following; temporarily un-rotate the page, or, temporarily remove the "Rotate" object from the annotation. To support users adding text annotations while using a PDF viewer, you can also add any viewer rotation to the annotations Rotate object, to have text always rotated correctly, from the users perspective.

##### Throws

PDFNetException |

#### public void refreshAppearance (RefreshOptions opts)

A version of RefreshAppearance allowing custom options to make slight tweaks in behaviour.

##### Throws

PDFNetException |

#### public void removeAppearance ()

Removes the annotation's default appearance.

##### Throws

PDFNetException |

#### public void removeAppearance (int annot_state, String app_state)

Removes the annotation's appearance for the given combination of annotation and appearance states.

##### Parameters

annot_state | the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
app_state | is an optional parameter specifying the appearance state (e.g. "Off", "On", etc) under which the new appearance should be stored. If appearance_state is NULL, the annotation will have only one annotaion state.

##### Throws

PDFNetException |

#### public void resize (Rect pos)

Resize annotation

##### Parameters

pos | size to resize to

##### Throws

PDFNetException |

#### public void setActiveAppearanceState (String astate)

Set the annotation's active appearance state. (Required if the appearance dictionary AP contains one or more subdictionaries; PDF'1.2)

##### Parameters

astate | a string representing the name of the new active appearance state. The string used to select the annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary.

##### Throws

PDFNetException |

#### public void setAppearance (Obj app_stream, int annot_state)

Set the annotation's appearance for the given combination of annotation and appearance states. (Optional; PDF'1.2)

##### Parameters

app_stream | a content stream defining the new appearance.
annot_state | the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.

##### Throws

PDFNetException |

#### public void setAppearance (Obj app_stream)

Set the annotation's appearance for the given combination of annotation and appearance states. (Optional; PDF'1.2)

##### Parameters

app_stream | a content stream defining the new appearance.

##### Throws

PDFNetException |

#### public void setAppearance (Obj app_stream, int annot_state, String app_state)

Set the annotation's appearance for the given combination of annotation and appearance states. (Optional; PDF'1.2)

##### Parameters

app_stream | a content stream defining the new appearance.
annot_state | the annotation's appearance state, which selects the applicable appearance stream from the appearance sub-dictionary. An annotation can define as many as three separate appearances: The normal, rollover, and down appearance.
app_state | is an optional parameter specifying the appearance state (e.g. "Off", "On", etc) under which the new appearance should be stored. If appearance_state is NULL, the annotation will have only one annotaion state.

##### Throws

PDFNetException |

#### public void setBorderStyle (Annot.BorderStyle bs)

Set the border style for the annotation. Typically used for Link annotations.

##### Parameters

bs | New border style for this annotation.

##### Throws

PDFNetException |

#### public void setColor (ColorPt cpt)

Set an annotation's color.

##### Parameters

cpt | a ColorPt containing color components in RGB ColorSpace

##### Throws

PDFNetException |

#### public void setColor (ColorPt cpt, int comp_num)

Set an annotation's color.

##### Parameters

cpt | a ColorPt containing color components based on the associated ColorSpace
comp_num | The color component number that indirectly implies the color space the color is from.

##### Throws

PDFNetException |

#### public void setContents (String ct)

Set annotation contents.

##### Parameters

ct | the new contents

##### Throws

PDFNetException |

#### public void setCustomData (String key, String value)

Sets the custom data associated with the specified key.

##### Parameters

key | The key under which to store this custom data.
value | The custom data string to store.

##### Throws

PDFNetException |

#### public void setDate (Date date)

Sets an annotation's last modified date.

##### Parameters

date | The annotation's last modified time and date. Corresponds to the "M" entry of the annotation dictionary.

##### Throws

PDFNetException |

#### public void setDateToNow ()

Sets an annotation's last modified date to the current time.

##### Throws

PDFNetException |

#### public void setFlag (int flag, boolean value)

Set the value of given Flag.

##### Parameters

flag | The Flag property to modify.
value | The new value for the property.

##### Throws

PDFNetException |

#### public void setOptionalContent (Obj oc)

Set optional content of an annotation. (Optional, PDF1.5).

##### Parameters

oc | An SDF object corresponding to the optional content, a PDF::OCG::Group or membership dictionary specifying the PDF::OCG::Group properties for the annotation. Before the annotation is drawn, its visibility shall be determined based on this entry as well as the annotation flags specified in the Flag entry . If it is determined to be invisible, the annotation shall be skipped, as if it were not in the document.

##### Throws

PDFNetException |

#### public void setPage (Page page)

Set the reference to a page the annotation is associated with. (Optional PDF'1.3; not used in FDF files)

Note: The parameter should be an indirect reference to the page object with which this annotation is associated. This entry shall be present in screen annotations associated with rendition actions

##### Parameters

page | the new page

##### Throws

PDFNetException |

#### public void setRect (Rect pos)

Set the size and location of an annotation on its page.

##### Parameters

pos | the new bound rectangle

##### Throws

PDFNetException |

#### public void setRotation (int rot)

Set the rotation value of the annotation. The Rotation specifies the number of degrees by which the annotation shall be rotated counterclockwise relative to the page. The value shall be a multiple of 90. (Optional)

Note: This property is part of the appearance characteristics dictionary, this dictionary that shall be used in constructing a dynamic appearance stream specifying the annotation's visual presentation on the page.

##### Parameters

rot | An integer representing the rotation value of the annotation.

##### Throws

PDFNetException |

#### public void setStructParent (int keyval)

Set the struct parent of an annotation. (Required if the annotation is a structural content item; PDF'1.3)

Note: The StructParent is the integer key of the annotation's entry in the structural parent tree.

##### Parameters

keyval | An integer which is the integer key of the annotation's entry in the structural parent tree.

##### Throws

PDFNetException |

#### public void setUniqueID (String icon_name)

Set the unique identifier for this annotation.

Note: It is necessary to ensure that the unique ID generated is actually unique.

##### Parameters

icon_name | the new unique id

##### Throws

PDFNetException |