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
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
From class java.lang.Object

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

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.

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.

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.

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".

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.

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.

public void removeAction ()

Removes a link annotation's action.

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.

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".

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