Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.graphics

public Class PDXObject

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Known Direct Subclasses
org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject, org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject, org.apache.pdfbox.pdmodel.graphics.PDPostScriptXObject
Imports
org.apache.pdfbox.cos.COSBase, .COSDictionary, .COSName, .COSStream, org.apache.pdfbox.pdmodel.PDDocument, .PDResources, .ResourceCache, org.apache.pdfbox.pdmodel.common.COSObjectable, .PDStream, org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject, .PDTransparencyGroup, org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject, java.io.IOException

An external object, or "XObject".
Authors
Ben Litchfield, John Hewson

Field Summary

Modifier and TypeField and Description
private final PDStream

Constructor Summary

AccessConstructor and Description
protected
PDXObject(COSStream
The stream to read.
stream
,
COSName
the subtype to be used for this XObject
subtype
)

Creates a new XObject from the given stream and subtype.

protected
PDXObject(PDStream
The stream to read.
stream
,
COSName
the subtype to be used for this XObject
subtype
)

Creates a new XObject from the given stream and subtype.

protected
PDXObject(PDDocument
The document in which to create the XObject.
document
,
COSName
The subtype of the new XObject.
subtype
)

Creates a new XObject of the given subtype for writing.

Method Summary

Modifier and TypeMethod and Description
public static PDXObject

Returns:

A new XObject instance.
createXObject
(COSBase
The stream which is wrapped by this XObject.
base
,
PDResources
the resources of this XObject
resources
)

Creates a new XObject instance of the appropriate type for the COS stream.

public final COSStream
public final PDStream

Returns:

The stream for this object.
getStream
()

Returns the stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

streamback to summary
private final PDStream stream

Constructor Detail

PDXObjectback to summary
protected PDXObject(COSStream stream, COSName subtype)

Creates a new XObject from the given stream and subtype.

Parameters
stream:COSStream

The stream to read.

subtype:COSName

the subtype to be used for this XObject

PDXObjectback to summary
protected PDXObject(PDStream stream, COSName subtype)

Creates a new XObject from the given stream and subtype.

Parameters
stream:PDStream

The stream to read.

subtype:COSName

the subtype to be used for this XObject

PDXObjectback to summary
protected PDXObject(PDDocument document, COSName subtype)

Creates a new XObject of the given subtype for writing.

Parameters
document:PDDocument

The document in which to create the XObject.

subtype:COSName

The subtype of the new XObject.

Method Detail

createXObjectback to summary
public static PDXObject createXObject(COSBase base, PDResources resources) throws IOException

Creates a new XObject instance of the appropriate type for the COS stream.

Parameters
base:COSBase

The stream which is wrapped by this XObject.

resources:PDResources

the resources of this XObject

Returns:PDXObject

A new XObject instance.

Exceptions
IOException:
if there is an error creating the XObject.
getCOSObjectback to summary
public final COSStream getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Doc from org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Returns the stream. Convert this standard java object to a COS object.

Returns:COSStream

The cos object that matches this Java object.

Annotations
@Override
getStreamback to summary
public final PDStream getStream()

Returns the stream.

Returns:PDStream

The stream for this object.