Class Annotation

    • Method Detail

      • copy

        public static Annotation copy​(Document targetDocument,
                                      Annotation annotation)
                               throws java.io.IOException,
                                      ConformanceException

        Copy an annotation

        Copy an annotation object from an input document to the given targetDocument. The returned object is associated with the given target document but not yet part of it.
        Parameters:
        targetDocument - the output document with which the returned object is associated
        annotation - the annotation to be copied to the targetDocument
        Returns:
        the copied annotation, associated with the targetDocument
        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 annotation is not associated with an input document
        java.lang.IllegalArgumentException - if the document associated with the annotation object has already been closed
        ConformanceException - The conformance level of the input document is not compatible with the conformance level of the targetDocument.
        java.io.IOException - Error reading from the input document or writing to the output document
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if annotation is null
      • getBoundingBox

        public Rectangle getBoundingBox()
                                 throws CorruptException

        The location on the page (Getter)

        Throws:
        java.lang.IllegalStateException - if the object has already been closed
        CorruptException - if the PDF is corrupt
      • getHidden

        public boolean getHidden()

        The annotation's visibility (Getter)

        If true then the annotation is present, but is invisible and not available for user interaction. Depending on the getNoPrint() property it will, however, still be visible when printing.
        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • getNoPrint

        public boolean getNoPrint()

        The annotation's visibility when printing (Getter)

        If true then the annotation is not present in a print output of the document.
        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • getNoZoom

        public boolean getNoZoom()

        The annotation's scaling behavior (Getter)

        If true then the annotation's visual appearance does not scale with the zoom factor of a PDF viewer.
        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • getNoRotate

        public boolean getNoRotate()

        The annotation's rotation behavior (Getter)

        If true then the annotation's visual appearance does not rotate with the rotation set in a PDF viewer.
        Throws:
        java.lang.IllegalStateException - if the object has already been closed
      • getId

        public java.lang.String getId()

        The annotation identifier (Getter)

        A text string uniquely identifying it among all the annotations on its page. When creating annotations using the SDK, a unique ID is set automatically.
        Throws:
        java.lang.IllegalStateException - if the object has already been closed