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

# Link

extends Annot

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

## Class Overview

A link annotation represents either a hypertext link to a destination elsewhere in the document or an action to be performed.

## Summary

Constants
int | e_invert | The Constant e_invert.
int | e_none | This integer list spedifies the Highlighting mode of the Link Annotation e_none - No highlighting.
int | e_outline | The Constant e_outline.
int | e_push | The Constant e_push.

[Expand] Inherited Constants
From class com.pdftron.pdf.Annot
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
| Link(Obj d) Creates a Link annotation and initialize it using given Cos/SDF object.
| Link() Creates an empty Link annotation and initialize it using given Cos/SDF object.
| Link(long impl, Object ref) Instantiates a new link.
| Link(Annot annot) Creates a Link annotation and initialize it using given annotation object.

Public Methods
static Link | create(Doc doc, Rect pos, Action action) Creates a new Link annotation.
static Link | create(Doc doc, Rect pos) Creates a new Link annotation.
Action | getAction() Get the Action of the Linked Annotation.
int | getHighlightingMode() Get the HighlightingMode Linked Annotation.
QuadPoint | getQuadPoint(int idx) Get the QuadPoint located at a certain index of the QuadPoint array of the Link annotation.
int | getQuadPointCount() Get the number of QuadPoints in the QuadPoints array of the Link annotation.
void | removeAction() Removes a link annotation's action.
void | setAction(Action action) Set the Action of the Linked Annotation.
void | setHighlightingMode(int mode) Set the HighlightingMode Linked Annotation.
void | setQuadPoint(int idx, QuadPoint qp) Set the QuadPoint to be located at a certain index of the QuadPoint array of the Link annotation.

[Expand] Inherited Methods
From class com.pdftron.pdf.Annot
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.
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_invert

The Constant e_invert.

Constant Value: 1 (0x00000001)

#### public static final int e_none

This integer list spedifies the Highlighting mode of the Link Annotation e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle. e_outline - Invert the annotation's border e_push - Display the annotation as if it were being pushed below the surface of the page.

Constant Value: 0 (0x00000000)

#### public static final int e_outline

The Constant e_outline.

Constant Value: 2 (0x00000002)

#### public static final int e_push

The Constant e_push.

Constant Value: 3 (0x00000003)

## Public Constructors

#### public Link (Obj d)

Creates a Link 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 input Cos/SDF object

#### public Link ()

Creates an empty Link 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.

#### public Link (long impl, Object ref)

Instantiates a new link.

##### Parameters

impl | the impl
ref | the ref

#### public Link (Annot annot)

Creates a Link annotation and initialize it using given annotation object.

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

##### Parameters

annot | the input annoation object

##### Throws

PDFNetException |

## Public Methods

#### public static Link create (Doc doc, Rect pos, Action action)

Creates a new Link annotation.

##### Parameters

doc | A document to which the annotation is added.
pos | A rectangle specifying the annotation's bounds, specified in user space coordinates.
action | Action for the link annotation.

##### Returns

- A new Link annotation.

##### Throws

PDFNetException |

#### public static Link create (Doc doc, Rect pos)

Creates a new Link annotation.

##### Parameters

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

##### Returns

- A new Link annotation.

##### Throws

PDFNetException |

#### public Action getAction ()

Get the Action of the Linked Annotation.

Note: The return value is an action that shall be performed when the link annotation is activated

##### Returns

- An Action object that denotes the action of the linked annotation.

##### Throws

PDFNetException |

#### public int getHighlightingMode ()

Get the HighlightingMode Linked Annotation.

Note: The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area, possible values as follows: e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle. e_outline - Invert the annotation's border e_push - Display the annotation as if it were being pushed below the surface of the page. Default value: e_invert.

##### Returns

- The HighLighting mode represented as an entry of the enum "HighlightingMode".

##### Throws

PDFNetException |

#### public QuadPoint getQuadPoint (int idx)

Get the QuadPoint located at a certain index of the QuadPoint array of the Link annotation.

Note: An array of n QuadPoints specifying the coordinates of n quadrilaterals in default user space that comprise the region in which the link should be activated. The coordinates specifying the four vertices of the quadrilateral in counterclockwise order. For orientation purposes, such as when applying an underline border style, the bottom of a quadrilateral is the line formed by p1 and p2 of the QuadPoint. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect.

##### Parameters

idx | the idx

##### Returns

- The QuadPoint located at a certain index of the QuadPoint array of the Link annotation.

##### Throws

PDFNetException |

#### public int getQuadPointCount ()

Get the number of QuadPoints in the QuadPoints array of the Link annotation.

Note: An array of n QuadPoints specifying the coordinates of n quadrilaterals in default user space that comprise the region in which the link should be activated. The coordinates specifying the four vertices of the quadrilateral in counterclockwise order. For orientation purposes, such as when applying an underline border style, the bottom of a quadrilateral is the line formed by p1 and p2 of the QuadPoint. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect.

##### Returns

- The number of QuadPoints.

##### Throws

PDFNetException |

#### public void removeAction ()

Removes a link annotation's action.

##### Throws

PDFNetException |

#### public void setAction (Action action)

Set the Action of the Linked Annotation. (Optional; PDF 1.1 )

Note: The parameter is an action that shall be performed when the link annotation is activated

##### Parameters

action | An Action object that denotes the action of the linked annotation.

##### Throws

PDFNetException |

#### public void setHighlightingMode (int mode)

Set the HighlightingMode Linked Annotation. (Optional; PDF 1.2 )

Note: The annotation's highlighting mode is the visual effect that shall be used when the mouse button is pressed or held down inside its active area, possible values as follows: e_none - No highlighting. e_invert - Invert the contents of the annotation rectangle. e_outline - Invert the annotation's border e_push - Display the annotation as if it were being pushed below the surface of the page. Default value: e_invert.

##### Parameters

mode | The HighLighting mode represented as an entry of the enum "HighlightingMode".

##### Throws

PDFNetException |

#### public void setQuadPoint (int idx, QuadPoint qp)

Set the QuadPoint to be located at a certain index of the QuadPoint array of the Link annotation. (Optional; PDF 1.6 )

Note: An array of n QuadPoints specifying the coordinates of n quadrilaterals in default user space that comprise the region in which the link should be activated. The coordinates specifying the four vertices of the quadrilateral in counterclockwise order. For orientation purposes, such as when applying an underline border style, the bottom of a quadrilateral is the line formed by p1 and p2 of the QuadPoint. QuadPoints shall be ignored if any coordinate in the array lies outside the region specified by Rect.

##### Parameters

idx | the index of the QuadPoint array
qp | the QuadPoint

##### Throws

PDFNetException |