Class PdfLinkAnnotation
PdfAction
to be performed. See also ISO-320001 12.5.6.5, "Link Annotations".
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PdfName
static final PdfName
Highlight modes.static final PdfName
static final PdfName
Fields inherited from class com.itextpdf.kernel.pdf.annot.PdfAnnotation
Accepted, Canceled, Completed, HIDDEN, HIGHLIGHT_INVERT, HIGHLIGHT_NONE, HIGHLIGHT_OUTLINE, HIGHLIGHT_PUSH, HIGHLIGHT_TOGGLE, INVISIBLE, LOCKED, LOCKED_CONTENTS, Marked, MarkedModel, NO_ROTATE, NO_VIEW, NO_ZOOM, page, PRINT, READ_ONLY, Rejected, ReviewModel, STYLE_BEVELED, STYLE_DASHED, STYLE_INSET, STYLE_SOLID, STYLE_UNDERLINE, TOGGLE_NO_VIEW, Unmarked
-
Constructor Summary
ModifierConstructorDescriptionPdfLinkAnnotation
(Rectangle rect) Creates a newPdfLinkAnnotation
instance based onRectangle
instance, that define the location of the annotation on the page in default user space units.protected
PdfLinkAnnotation
(PdfDictionary pdfObject) Creates a newPdfLinkAnnotation
instance based onPdfDictionary
instance, that represents existing annotation object in the document. -
Method Summary
Modifier and TypeMethodDescriptionAnPdfAction
to perform, such as launching an application, playing a sound, changing an annotation’s appearance state etc, when the annotation is activated.BS entry specifies a border style dictionary that has more settings than the array specified for the Border entry (seePdfAnnotation.getBorder()
).Gets the annotation destination asPdfObject
instance.Gets the annotation highlight mode.An array of 8 × n numbers specifying the coordinates of n quadrilaterals in default user space.Gets aPdfName
which value is a subtype of this annotation.Gets the annotation URI action asPdfDictionary
.Removes aPdfAction
from this annotation.Removes the annotation destination.Sets aPdfAction
to this annotation which will be performed when the annotation is activated.setAction
(PdfDictionary action) Sets aPdfDictionary
representing action to this annotation which will be performed when the annotation is activated.setBorderStyle
(PdfDictionary borderStyle) Sets border style dictionary that has more settings than the array specified for the Border entry (PdfAnnotation.getBorder()
).setBorderStyle
(PdfName style) Setter for the annotation's preset border style.setDashPattern
(PdfArray dashPattern) Setter for the annotation's preset dashed border style.setDestination
(PdfDestination destination) Sets the annotation destination asPdfDestination
instance.setDestination
(PdfObject destination) Sets the annotation destination asPdfObject
instance.setHighlightMode
(PdfName hlMode) Sets the annotation highlight mode.setQuadPoints
(PdfArray quadPoints) Sets n quadrilaterals in default user space by passing anPdfArray
of 8 × n numbers.setUriAction
(PdfAction action) Sets the annotation URI action asPdfAction
instance.setUriAction
(PdfDictionary action) Sets the annotation URI action asPdfDictionary
instance.Methods inherited from class com.itextpdf.kernel.pdf.annot.PdfAnnotation
addAssociatedFile, flush, getAppearanceDictionary, getAppearanceObject, getAppearanceState, getAssociatedFiles, getBlendMode, getBorder, getColorObject, getContents, getDate, getDownAppearanceObject, getFlags, getLang, getName, getNonStrokingOpacity, getNormalAppearanceObject, getPage, getPageObject, getRectangle, getRolloverAppearanceObject, getStrokingOpacity, getStructParentIndex, getTitle, hasFlag, isWrappedObjectMustBeIndirect, makeAnnotation, put, remove, resetFlag, setAppearance, setAppearance, setAppearanceState, setBlendMode, setBorder, setBorder, setColor, setColor, setColor, setContents, setContents, setDate, setDownAppearance, setDownAppearance, setFlag, setFlags, setLang, setLayer, setName, setNonStrokingOpacity, setNormalAppearance, setNormalAppearance, setPage, setRectangle, setRolloverAppearance, setRolloverAppearance, setStrokingOpacity, setStructParentIndex, setTitle
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Field Details
-
None
Highlight modes. -
Invert
-
Outline
-
Push
-
-
Constructor Details
-
PdfLinkAnnotation
Creates a newPdfLinkAnnotation
instance based onPdfDictionary
instance, that represents existing annotation object in the document.- Parameters:
-
pdfObject
- thePdfDictionary
representing annotation object - See Also:
-
PdfLinkAnnotation
Creates a newPdfLinkAnnotation
instance based onRectangle
instance, that define the location of the annotation on the page in default user space units.- Parameters:
-
rect
- theRectangle
that define the location of the annotation
-
-
Method Details
-
getSubtype
Description copied from class:PdfAnnotation
Gets aPdfName
which value is a subtype of this annotation. See ISO-320001 12.5.6, "Annotation Types" for the reference to the possible types.- Specified by:
-
getSubtype
in classPdfAnnotation
- Returns:
- subtype of this annotation.
-
getDestinationObject
Gets the annotation destination asPdfObject
instance.Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.
- Returns:
-
the annotation destination as
PdfObject
instance
-
setDestination
Sets the annotation destination asPdfObject
instance.Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.
- Parameters:
-
destination
- the destination to be set asPdfObject
instance - Returns:
-
this
PdfLinkAnnotation
instance
-
removeDestination
Removes the annotation destination.Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.
- Returns:
-
this
PdfLinkAnnotation
instance
-
getAction
AnPdfAction
to perform, such as launching an application, playing a sound, changing an annotation’s appearance state etc, when the annotation is activated.- Returns:
-
PdfDictionary
which defines the characteristics and behaviour of an action
-
setAction
Sets aPdfDictionary
representing action to this annotation which will be performed when the annotation is activated.- Parameters:
-
action
-PdfDictionary
that represents action to set to this annotation - Returns:
-
this
PdfLinkAnnotation
instance
-
setAction
Sets aPdfAction
to this annotation which will be performed when the annotation is activated.- Parameters:
-
action
-PdfAction
to set to this annotation - Returns:
-
this
PdfLinkAnnotation
instance
-
removeAction
Removes aPdfAction
from this annotation.- Returns:
-
this
PdfLinkAnnotation
instance
-
getHighlightMode
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.
- Returns:
- the name of visual effect
-
setHighlightMode
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.
- Parameters:
-
hlMode
- the name of visual effect to be set - Returns:
-
this
PdfLinkAnnotation
instance
-
getUriActionObject
Gets the annotation URI action asPdfDictionary
.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.
- Returns:
- the URI action as pdfDictionary
-
setUriAction
Sets the annotation URI action asPdfDictionary
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.
- Parameters:
-
action
- the action to be set - Returns:
-
this
PdfLinkAnnotation
instance
-
setUriAction
Sets the annotation URI action asPdfAction
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.
- Parameters:
-
action
- the action to be set - Returns:
-
this
PdfLinkAnnotation
instance
-
getQuadPoints
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.- Returns:
-
an
PdfArray
of 8 × n numbers specifying the coordinates of n quadrilaterals.
-
setQuadPoints
Sets n quadrilaterals in default user space by passing anPdfArray
of 8 × n numbers. Quadrilaterals are used to define regions inside annotation rectangle in which the link annotation should be activated.- Parameters:
-
quadPoints
- anPdfArray
of 8 × n numbers specifying the coordinates of n quadrilaterals. - Returns:
-
this
PdfLinkAnnotation
instance.
-
getBorderStyle
BS entry specifies a border style dictionary that has more settings than the array specified for the Border entry (seePdfAnnotation.getBorder()
). If an annotation dictionary includes the BS entry, then the Border entry is ignored. If annotation includes AP (seePdfAnnotation.getAppearanceDictionary()
) it takes precedence over the BS entry. For more info on BS entry see ISO-320001, Table 166.- Returns:
-
PdfDictionary
which is a border style dictionary or null if it is not specified.
-
setBorderStyle
Sets border style dictionary that has more settings than the array specified for the Border entry (PdfAnnotation.getBorder()
). See ISO-320001, Table 166 andgetBorderStyle()
for more info.- Parameters:
-
borderStyle
- a border style dictionary specifying the line width and dash pattern that shall be used in drawing the annotation’s border. - Returns:
-
this
PdfLinkAnnotation
instance.
-
setBorderStyle
Setter for the annotation's preset border style. Possible values arePdfAnnotation.STYLE_SOLID
- A solid rectangle surrounding the annotation.PdfAnnotation.STYLE_DASHED
- A dashed rectangle surrounding the annotation.PdfAnnotation.STYLE_BEVELED
- A simulated embossed rectangle that appears to be raised above the surface of the page.PdfAnnotation.STYLE_INSET
- A simulated engraved rectangle that appears to be recessed below the surface of the page.PdfAnnotation.STYLE_UNDERLINE
- A single line along the bottom of the annotation rectangle.
- Parameters:
-
style
- The new value for the annotation's border style. - Returns:
-
this
PdfLinkAnnotation
instance. - See Also:
-
setDashPattern
Setter for the annotation's preset dashed border style. This property has affect only ifPdfAnnotation.STYLE_DASHED
style was used for the annotation border style (seesetBorderStyle(PdfName)
. See ISO-320001 8.4.3.6, "Line Dash Pattern" for the format in which dash pattern shall be specified.- Parameters:
-
dashPattern
- a dash array defining a pattern of dashes and gaps that shall be used in drawing a dashed border. - Returns:
-
this
PdfLinkAnnotation
instance.
-