Table of Contents

Class PdfLinkAnnotation

Namespace
iText.Kernel.Pdf.Annot
Assembly
itext.kernel.dll

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

public class PdfLinkAnnotation : PdfAnnotation
Inheritance
PdfLinkAnnotation
Inherited Members

Remarks

A link annotation represents either a hypertext link to a destination elsewhere in the document or an PdfAction to be performed. See also ISO-320001 12.5.6.5, "Link Annotations".

Constructors

PdfLinkAnnotation(Rectangle)

Creates a new PdfLinkAnnotation instance based on Rectangle instance, that define the location of the annotation on the page in default user space units.

public PdfLinkAnnotation(Rectangle rect)

Parameters

rect Rectangle

the Rectangle that define the location of the annotation

PdfLinkAnnotation(PdfDictionary)

Creates a new PdfLinkAnnotation instance based on PdfDictionary instance, that represents existing annotation object in the document.

protected PdfLinkAnnotation(PdfDictionary pdfObject)

Parameters

pdfObject PdfDictionary

the PdfDictionary representing annotation object

See Also

Fields

Invert

public static readonly PdfName Invert

Field Value

PdfName

None

Highlight modes.

public static readonly PdfName None

Field Value

PdfName

Outline

public static readonly PdfName Outline

Field Value

PdfName

Push

public static readonly PdfName Push

Field Value

PdfName

Methods

GetAction()

An PdfAction to perform, such as launching an application, playing a sound, changing an annotation’s appearance state etc, when the annotation is activated.

public virtual PdfDictionary GetAction()

Returns

PdfDictionary

PdfDictionary which defines the characteristics and behaviour of an action

GetBorderStyle()

BS entry specifies a border style dictionary that has more settings than the array specified for the Border entry (see GetBorder() ).

public virtual PdfDictionary GetBorderStyle()

Returns

PdfDictionary

PdfDictionary which is a border style dictionary or null if it is not specified.

Remarks

BS entry specifies a border style dictionary that has more settings than the array specified for the Border entry (see GetBorder() ). If an annotation dictionary includes the BS entry, then the Border entry is ignored. If annotation includes AP (see GetAppearanceDictionary() ) it takes precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166.

GetDestinationObject()

Gets the annotation destination as PdfObject instance.

public virtual PdfObject GetDestinationObject()

Returns

PdfObject

the annotation destination as PdfObject instance

Remarks

Gets the annotation destination as PdfObject instance.

Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.

GetHighlightMode()

Gets the annotation highlight mode.

public virtual PdfName GetHighlightMode()

Returns

PdfName

the name of visual effect

Remarks

Gets the annotation highlight mode.

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. See also ISO-320001, Table 173.

GetQuadPoints()

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space.

public virtual PdfArray GetQuadPoints()

Returns

PdfArray

an PdfArray of 8 × n numbers specifying the coordinates of n quadrilaterals.

Remarks

An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space. Quadrilaterals are used to define regions inside annotation rectangle in which the link annotation should be activated.

GetSubtype()

public override PdfName GetSubtype()

Returns

PdfName

GetUriActionObject()

Gets the annotation URI action as PdfDictionary.

public virtual PdfDictionary GetUriActionObject()

Returns

PdfDictionary

the URI action as pdfDictionary

Remarks

Gets the annotation URI action as PdfDictionary.

When Web Capture (see ISO-320001 14.10, “Web Capture”) changes an annotation from a URI to a go-to action, it uses this entry to save the data from the original URI action so that it can be changed back in case the target page for the go-to action is subsequently deleted. See also ISO-320001, Table 173.

RemoveAction()

Removes a PdfAction from this annotation.

public virtual PdfLinkAnnotation RemoveAction()

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

RemoveDestination()

Removes the annotation destination.

public virtual PdfLinkAnnotation RemoveDestination()

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

Remarks

Removes the annotation destination.

Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.

SetAction(PdfAction)

Sets a PdfAction to this annotation which will be performed when the annotation is activated.

public virtual PdfLinkAnnotation SetAction(PdfAction action)

Parameters

action PdfAction

PdfAction to set to this annotation

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

SetAction(PdfDictionary)

Sets a PdfDictionary representing action to this annotation which will be performed when the annotation is activated.

public virtual PdfLinkAnnotation SetAction(PdfDictionary action)

Parameters

action PdfDictionary

PdfDictionary that represents action to set to this annotation

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

SetBorderStyle(PdfDictionary)

Sets border style dictionary that has more settings than the array specified for the Border entry ( GetBorder() ).

public virtual PdfLinkAnnotation SetBorderStyle(PdfDictionary borderStyle)

Parameters

borderStyle PdfDictionary

a border style dictionary specifying the line width and dash pattern that shall be used in drawing the annotation’s border.

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance.

Remarks

Sets border style dictionary that has more settings than the array specified for the Border entry ( GetBorder() ). See ISO-320001, Table 166 and GetBorderStyle() for more info.

SetBorderStyle(PdfName)

Setter for the annotation's preset border style.

public virtual PdfLinkAnnotation SetBorderStyle(PdfName style)

Parameters

style PdfName

The new value for the annotation's border style.

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance.

Remarks

Setter for the annotation's preset border style. Possible values are

  • STYLE_SOLID - A solid rectangle surrounding the annotation.
  • STYLE_DASHED - A dashed rectangle surrounding the annotation.
  • STYLE_BEVELED - A simulated embossed rectangle that appears to be raised above the surface of the page.
  • STYLE_INSET - A simulated engraved rectangle that appears to be recessed below the surface of the page.
  • STYLE_UNDERLINE - A single line along the bottom of the annotation rectangle.
See also ISO-320001, Table 166.
See Also

SetDashPattern(PdfArray)

Setter for the annotation's preset dashed border style.

public virtual PdfLinkAnnotation SetDashPattern(PdfArray dashPattern)

Parameters

dashPattern PdfArray

a dash array defining a pattern of dashes and gaps that shall be used in drawing a dashed border.

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance.

Remarks

Setter for the annotation's preset dashed border style. This property has affect only if STYLE_DASHED style was used for the annotation border style (see SetBorderStyle(PdfName). See ISO-320001 8.4.3.6, "Line Dash Pattern" for the format in which dash pattern shall be specified.

SetDestination(PdfDestination)

Sets the annotation destination as PdfDestination instance.

public virtual PdfLinkAnnotation SetDestination(PdfDestination destination)

Parameters

destination PdfDestination

the destination to be set as PdfDestination instance

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

Remarks

Sets the annotation destination as PdfDestination instance.

Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.

SetDestination(PdfObject)

Sets the annotation destination as PdfObject instance.

public virtual PdfLinkAnnotation SetDestination(PdfObject destination)

Parameters

destination PdfObject

the destination to be set as PdfObject instance

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

Remarks

Sets the annotation destination as PdfObject instance.

Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.

SetHighlightMode(PdfName)

Sets the annotation highlight mode.

public virtual PdfLinkAnnotation SetHighlightMode(PdfName hlMode)

Parameters

hlMode PdfName

the name of visual effect to be set

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

Remarks

Sets the annotation highlight mode.

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. See also ISO-320001, Table 173.

SetQuadPoints(PdfArray)

Sets n quadrilaterals in default user space by passing an PdfArray of 8 × n numbers.

public virtual PdfLinkAnnotation SetQuadPoints(PdfArray quadPoints)

Parameters

quadPoints PdfArray

an PdfArray of 8 × n numbers specifying the coordinates of n quadrilaterals.

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance.

Remarks

Sets n quadrilaterals in default user space by passing an PdfArray of 8 × n numbers. Quadrilaterals are used to define regions inside annotation rectangle in which the link annotation should be activated.

SetUriAction(PdfAction)

Sets the annotation URI action as PdfAction instance.

public virtual PdfLinkAnnotation SetUriAction(PdfAction action)

Parameters

action PdfAction

the action to be set

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

Remarks

Sets the annotation URI action as PdfAction instance.

A URI action (see ISO-320001 12.6.4.7, “URI Actions”) formerly associated with this annotation. When Web Capture (see ISO-320001 14.10, “Web Capture”) changes an annotation from a URI to a go-to action, it uses this entry to save the data from the original URI action so that it can be changed back in case the target page for the go-to action is subsequently deleted. See also ISO-320001, Table 173.

SetUriAction(PdfDictionary)

Sets the annotation URI action as PdfDictionary instance.

public virtual PdfLinkAnnotation SetUriAction(PdfDictionary action)

Parameters

action PdfDictionary

the action to be set

Returns

PdfLinkAnnotation

this PdfLinkAnnotation instance

Remarks

Sets the annotation URI action as PdfDictionary instance.

When Web Capture (see ISO-320001 14.10, “Web Capture”) changes an annotation from a URI to a go-to action, it uses this entry to save the data from the original URI action so that it can be changed back in case the target page for the go-to action is subsequently deleted. See also ISO-320001, Table 173.