Class: LinkAnnot

PDFNet. LinkAnnot


new LinkAnnot()

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

Methods


<static> create(doc, pos)

Creates a new Link annotation in the specified document.

Parameters:
Name Type Description
doc PDFNet.SDFDoc

A document to which the Link annotation is added.

pos PDFNet.rect

A rectangle specifying the Link annotation's bounds in default user space units.

Returns:

A promise that resolves to a newly created blank Link annotation.

Type
PDFNet.LinkAnnot

<static> createFromAnnot(ann)

creates a Link annotation and initializes it using given annotation object.

Parameters:
Name Type Description
ann PDFNet.Annot

Annot object used to initialize the Link annotation.

Returns:

A promise that resolves to an object of type: "LinkAnnot"

Type
PDFNet.LinkAnnot

<static> createFromObj(d)

creates a Link annotation and initializes it using given Cos/SDF object.

Parameters:
Name Type Description
d PDFNet.Obj

The Cos/SDF object to initialze the annotation with.

Returns:

A promise that resolves to an object of type: "LinkAnnot"

Type
PDFNet.LinkAnnot

getAction()

Returns the Action of the Link Annotation.

Returns:

A promise that resolves to an Action object of the Link annotation.

Type
PDFNet.Action

getHighlightingMode()

Returns the highlighting mode of this Link annotation.

Returns:

A promise that resolves to the highLighting mode as a value of the enum "HighlightingMode".

Type
number
Example
Return value enum:
<pre>
PDFNet.LinkAnnot.HighlightingMode = {
	e_none : 0
	e_invert : 1
	e_outline : 2
	e_push : 3
}
</pre>

getQuadPoint(idx)

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

Parameters:
Name Type Description
idx number

The index of the QuadPoint, starts at zero and should be less than the return value of GetQuadPointCount().

Returns:

A promise that resolves to the QuadPoint located at a certain index of the QuadPoint array of the Link annotation.

Type
PDFNet.quadpoint

getQuadPointCount()

Returns the number of QuadPoints in the 'QuadPoints' array of the Link annotation.

Returns:

A promise that resolves to the number of QuadPoints.

Type
number

removeAction()

removes this annotation's action.


setAction(action)

sets the Action of the Link Annotation. (Optional; PDF 1.1 )

Parameters:
Name Type Description
action PDFNet.Action

An Action object that shall be associated with this Link annotation.


setHighlightingMode(value)

Sets the highlighting mode for this Link annotation. (Optional; PDF 1.2 )

Parameters:
Name Type Description
value number/enum
PDFNet.LinkAnnot.HighlightingMode = {
	e_none : 0
	e_invert : 1
	e_outline : 2
	e_push : 3
}

the mode as a value of the enum "HighlightingMode".


setQuadPoint(idx, qp)

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

Parameters:
Name Type Description
idx number

The index of the QuadPoint, starts at zero and should be less than the return value of GetQuadPointCount().

qp PDFNet.quadpoint

The QuadPoint to be stored in the annotation.