Class PDXObject
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.PDXObject
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDFormXObject,PDImageXObject,PDPostScriptXObject
An external object, or "XObject".
- Author:
- Ben Litchfield, John Hewson
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new XObject from the given stream and subtype.protectedCreates a new XObject from the given stream and subtype.protectedPDXObject(PDDocument document, COSName subtype) Creates a new XObject of the given subtype for writing. -
Method Summary
Modifier and TypeMethodDescriptionstatic PDXObjectcreateXObject(COSBase base, PDResources resources) Creates a new XObject instance of the appropriate type for the COS stream.final COSStreamReturns the stream.final COSStreamDeprecated.final PDStreamDeprecated.UsegetStream()instead.final PDStreamReturns the stream.
-
Constructor Details
-
PDXObject
Creates a new XObject from the given stream and subtype.- Parameters:
stream- The stream to read.subtype-
-
PDXObject
Creates a new XObject from the given stream and subtype.- Parameters:
stream- The stream to read.subtype-
-
PDXObject
Creates a new XObject of the given subtype for writing.- Parameters:
document- The document in which to create the XObject.subtype- The subtype of the new XObject.
-
-
Method Details
-
createXObject
Creates a new XObject instance of the appropriate type for the COS stream.- Parameters:
base- The stream which is wrapped by this XObject.resources-- Returns:
- A new XObject instance.
- Throws:
IOException- if there is an error creating the XObject.
-
getCOSObject
Returns the stream. Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
getCOSStream
Deprecated.usegetCOSObject()Returns the stream.- Returns:
- The stream for this object.
-
getPDStream
Deprecated.UsegetStream()instead.Returns the stream.- Returns:
- The stream for this object.
-
getStream
Returns the stream.- Returns:
- The stream for this object.
-
getCOSObject()