Class PdfLinkAnnotation


  • public class PdfLinkAnnotation
    extends PdfAnnotation
    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".
    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • None

        public static final PdfName None
        Highlight modes.
      • Invert

        public static final PdfName Invert
      • Outline

        public static final PdfName Outline
      • Push

        public static final PdfName Push
    • Method Detail

      • getSubtype

        public PdfName getSubtype()
        Description copied from class: PdfAnnotation
        Gets a PdfName 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 class PdfAnnotation
        Returns:
        subtype of this annotation.
      • getDestinationObject

        public PdfObject getDestinationObject()
        Gets the annotation destination as PdfObject instance.

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

        Returns:
        the annotation destination as PdfObject instance
      • setDestination

        public PdfLinkAnnotation setDestination​(PdfObject destination)
        Sets the annotation destination as PdfObject instance.

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

        Parameters:
        destination - the destination to be set as PdfObject instance
        Returns:
        this PdfLinkAnnotation instance
      • removeDestination

        public PdfLinkAnnotation 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

        public PdfDictionary 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.
        Returns:
        PdfDictionary which defines the characteristics and behaviour of an action
      • getHighlightMode

        public PdfName 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

        public PdfLinkAnnotation setHighlightMode​(PdfName hlMode)
        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

        public PdfDictionary getUriActionObject()
        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.

        Returns:
        the URI action as pdfDictionary
      • setUriAction

        public PdfLinkAnnotation setUriAction​(PdfDictionary action)
        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.

        Parameters:
        action - the action to be set
        Returns:
        this PdfLinkAnnotation instance
      • setUriAction

        public PdfLinkAnnotation setUriAction​(PdfAction action)
        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.

        Parameters:
        action - the action to be set
        Returns:
        this PdfLinkAnnotation instance
      • getQuadPoints

        public PdfArray 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

        public PdfLinkAnnotation setQuadPoints​(PdfArray quadPoints)
        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.
        Parameters:
        quadPoints - an PdfArray of 8 × n numbers specifying the coordinates of n quadrilaterals.
        Returns:
        this PdfLinkAnnotation instance.
      • getBorderStyle

        public PdfDictionary getBorderStyle()
        BS entry specifies a border style dictionary that has more settings than the array specified for the Border entry (see PdfAnnotation.getBorder()). If an annotation dictionary includes the BS entry, then the Border entry is ignored. If annotation includes AP (see PdfAnnotation.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

        public PdfLinkAnnotation setBorderStyle​(PdfDictionary borderStyle)
        Sets border style dictionary that has more settings than the array specified for the Border entry (PdfAnnotation.getBorder()). See ISO-320001, Table 166 and getBorderStyle() 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.
      • setDashPattern

        public PdfLinkAnnotation setDashPattern​(PdfArray dashPattern)
        Setter for the annotation's preset dashed border style. This property has affect only if PdfAnnotation.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.
        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.