Class ContentElement

    • Method Detail

      • copy

        public static ContentElement copy​(Document targetDocument,
                                          ContentElement contentElement)
                                   throws java.io.IOException,
                                          ConformanceException

        Copy a content element

        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
        contentElement - a content element of a different document
        Returns:
        the copied content element, associated with the current document
        Throws:
        java.io.IOException - Error reading from the source document or writing to the target document
        ConformanceException - The conformance level of the source document is not compatible with the conformance level of the target document.
        ConformanceException - The conformance of the targetDocument is PDF/A with a conformance level "a": PDF/A-1a, PDF/A-2a, PDF/A-3a.
        java.lang.IllegalArgumentException - if the targetDocument argument has already been closed
        java.lang.IllegalArgumentException - if the targetDocument argument is read-only
        java.lang.IllegalArgumentException - the contentElement object is not associated with an input document
        java.lang.IllegalArgumentException - the document associated with the contentElement object has already been closed
        java.lang.IllegalArgumentException - if targetDocument is null
        java.lang.IllegalArgumentException - if contentElement is null
      • getBoundingBox

        public Rectangle getBoundingBox()

        the bounding box (Getter)

        This is a rectangle that encompasses all parts of an element.
        Throws:
        java.lang.IllegalStateException - the object has already been closed
      • getTransform

        public AffineTransform getTransform()

        the transform to be applied to the alignment rectangle (Getter)

        Use this transform matrix to compute the actual location of the element's alignment rectangle.
        Throws:
        java.lang.IllegalStateException - the object has already been closed
      • setTransform

        public void setTransform​(AffineTransform value)

        the transform to be applied to the alignment rectangle (Setter)

        Use this transform matrix to compute the actual location of the element's alignment rectangle.
        Throws:
        java.lang.IllegalStateException - the object has already been closed
        java.lang.IllegalArgumentException - if the transform to be set is non-invertible
        java.lang.UnsupportedOperationException - if the document is read-only
        java.lang.IllegalArgumentException - if value is null
      • getOcm

        public OptionalContentMembership getOcm()
        Defines the visibility of the content element depending on the optional content groups (OCGs).
        Throws:
        java.lang.IllegalStateException - the object has already been closed