Class PDXObject
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.xobject.PDXObject
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDXObjectForm
,PDXObjectImage
The base class for all XObjects in the PDF document.
- Author:
- Ben Litchfield, mathiak, Marcel Kammer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Calling this will release all cached information.protected static PDXObject
commonXObjectCreation
(COSBase xobject, boolean isThumb) Create the correct xobject from the cos base.static PDXObject
createXObject
(COSBase xobject) Create the correct xobject from the cos base.Returns the stream.Returns the stream.Get the metadata that is part of the document catalog.Returns the stream.int
This will get the key of this XObject in the structural parent tree.void
setMetadata
(PDMetadata meta) Set the metadata for this object.void
setStructParent
(int structParent) This will set the key for this XObject in the structural parent tree.
-
Constructor Details
-
PDXObject
Standard constructor.- Parameters:
xobj
- The XObject dictionary.
-
PDXObject
Standard constuctor.- Parameters:
xobj
- The XObject dictionary.
-
PDXObject
Standard constuctor.- Parameters:
doc
- The doc to store the object contents.
-
-
Method Details
-
getCOSObject
Returns the stream. Convert this standard java object to a COS object.- Specified by:
getCOSObject
in interfaceCOSObjectable
- Returns:
- The cos object that matches this Java object.
-
getCOSStream
Returns the stream.- Returns:
- The stream for this object.
-
getPDStream
Returns the stream.- Returns:
- The stream for this object.
-
createXObject
Create the correct xobject from the cos base.- Parameters:
xobject
- The cos level xobject to create.- Returns:
- a pdmodel xobject
- Throws:
IOException
- If there is an error creating the xobject.
-
commonXObjectCreation
Create the correct xobject from the cos base.- Parameters:
xobject
- The cos level xobject to create.isThumb
- specify if the xobject represent a Thumbnail Image (in this case, the subtype null must be considered as an Image)- Returns:
- a pdmodel xobject
- Throws:
IOException
- If there is an error creating the xobject.
-
getMetadata
Get the metadata that is part of the document catalog. This will return null if there is no meta data for this object.- Returns:
- The metadata for this object.
-
setMetadata
Set the metadata for this object. This can be null.- Parameters:
meta
- The meta data for this object.
-
getStructParent
public int getStructParent()This will get the key of this XObject in the structural parent tree. Required if the form XObject is a structural content item.- Returns:
- the integer key of the XObject's entry in the structural parent tree
-
setStructParent
public void setStructParent(int structParent) This will set the key for this XObject in the structural parent tree.- Parameters:
structParent
- The new key for this XObject.
-
clear
public void clear()Calling this will release all cached information.
-