Package com.pdftools.toolbox.pdf.content
Class ContentElement
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.content.ContentElement
-
- Direct Known Subclasses:
GroupElement
,ImageElement
,ImageMaskElement
,PathElement
,ShadingElement
,TextElement
public abstract class ContentElement extends NativeObject
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContentElement
copy(Document targetDocument, ContentElement contentElement)
Copy a content elementRectangle
getBoundingBox()
the bounding box (Getter)OptionalContentMembership
getOcm()
Defines the visibility of the content element depending on the optional content groups (OCGs).AffineTransform
getTransform()
the transform to be applied to the alignment rectangle (Getter)void
setTransform(AffineTransform value)
the transform to be applied to the alignment rectangle (Setter)-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
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 associatedcontentElement
- 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 documentConformanceException
- The conformance level of the source document is not compatible with the conformance level of the target document.ConformanceException
- The conformance of thetargetDocument
is PDF/A with a conformance level "a": PDF/A-1a, PDF/A-2a, PDF/A-3a.java.lang.IllegalArgumentException
- if thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- thecontentElement
object is not associated with an input documentjava.lang.IllegalArgumentException
- the document associated with thecontentElement
object has already been closedjava.lang.IllegalArgumentException
- iftargetDocument
isnull
java.lang.IllegalArgumentException
- ifcontentElement
isnull
-
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 closedjava.lang.IllegalArgumentException
- if the transform to be set is non-invertiblejava.lang.UnsupportedOperationException
- if the document is read-onlyjava.lang.IllegalArgumentException
- ifvalue
isnull
-
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
-
-