Class EmbeddedPdfLink


  • public class EmbeddedPdfLink
    extends Link

    A link to an embedded PDF document

    • Method Detail

      • create

        public static EmbeddedPdfLink create​(Document targetDocument,
                                             Rectangle boundingBox,
                                             FileReference fileReference)

        Create a link to an embedded PDF document

        The link is associated with the targetDocument but not yet part of any page. It can be added to a page's list of links.
        Parameters:
        targetDocument - The output document with which the returned object is associated
        boundingBox - The location on the page
        fileReference - The embedded PDF file
        Returns:
        The newly created object
        Throws:
        java.lang.IllegalArgumentException - if the targetDocument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument is read-only
        java.lang.IllegalArgumentException - if the document associated with the fileReference argument has already been closed
        java.lang.IllegalArgumentException - if the fileReference argument does not contain a PDF document
        java.lang.IllegalArgumentException - if the fileReference argument is neither used in a file attachment annotation nor has it been appended to the targetDocument's list of plain embedded or associated files.
        java.lang.IllegalArgumentException - if the fileReference argument is used in a file attachment annotation and this annotation has not been appended to a page's list of annotations.
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if boundingBox is null
        java.lang.IllegalArgumentException - if fileReference is null
      • createFromQuadrilaterals

        public static EmbeddedPdfLink createFromQuadrilaterals​(Document targetDocument,
                                                               QuadrilateralList activeArea,
                                                               FileReference fileReference)

        Create a link to an embedded PDF document with defined link area

        The link has an active area defined by the given activeArea. The link is associated with the targetDocument but not yet part of any page. It can be added to a page's list of links.
        Parameters:
        targetDocument - The document in which the links is used
        activeArea - The active link area on the page.
        fileReference - The embedded PDF file
        Returns:
        The newly created object
        Throws:
        java.lang.IllegalArgumentException - if the targetDocument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument is read-only
        java.lang.IllegalArgumentException - if the document associated with the fileReference argument has already been closed
        java.lang.IllegalArgumentException - if the fileReference argument does not contain a PDF document
        java.lang.IllegalArgumentException - if the fileReference argument is neither used in a file attachment annotation nor has it been appended to the targetDocument's list of plain embedded or associated files.
        java.lang.IllegalArgumentException - if the fileReference argument is used in a file attachment annotation and this annotation has not been appended to a page's list of annotations.
        java.lang.IllegalArgumentException - if the activeArea is empty
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if activeArea is null
        java.lang.IllegalArgumentException - if fileReference is null
      • getNewWindow

        public java.lang.Boolean getNewWindow()

        The opening behavior (Getter)

        This defines the viewer's behavior when opening the target PDF document.
        • null: The viewer uses its default behavior.
        • true: Open the document in an additional window.
        • false: Replace the parent document with the embedded document.
        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • setNewWindow

        public void setNewWindow​(java.lang.Boolean value)

        The opening behavior (Setter)

        This defines the viewer's behavior when opening the target PDF document.
        • null: The viewer uses its default behavior.
        • true: Open the document in an additional window.
        • false: Replace the parent document with the embedded document.
        Throws:
        java.lang.IllegalStateException - if the object has already been closed
        java.lang.UnsupportedOperationException - if the document is read-only
        java.lang.IllegalStateException - if the annotation has already been appended to a page's list of annotations