org.pdfbox.pdmodel.graphics.xobject

Class PDXObject

Implemented Interfaces:
COSObjectable
Known Direct Subclasses:
PDXObjectForm, PDXObjectImage

public abstract class PDXObject
extends java.lang.Object
implements COSObjectable

The base class for all XObjects in the PDF document.
Version:
$Revision: 1.13 $
Authors:
Ben Litchfield
mathiak
Marcel Kammer

Constructor Summary

PDXObject(COSStream xobj)
Standard constuctor.
PDXObject(PDDocument doc)
Standard constuctor.
PDXObject(PDStream xobj)
Standard constuctor.

Method Summary

static PDXObject
createXObject(COSBase xobject)
Create the correct xobject from the cos base.
COSBase
getCOSObject()
Returns the stream.
COSStream
getCOSStream()
Returns the stream.
PDMetadata
getMetadata()
Get the metadata that is part of the document catalog.
PDStream
getPDStream()
Returns the stream.
void
setMetadata(PDMetadata meta)
Set the metadata for this object.

Constructor Details

PDXObject

public PDXObject(COSStream xobj)
Standard constuctor.
Parameters:
xobj - The XObject dictionary.

PDXObject

public PDXObject(PDDocument doc)
Standard constuctor.
Parameters:
doc - The doc to store the object contents.

PDXObject

public PDXObject(PDStream xobj)
Standard constuctor.
Parameters:
xobj - The XObject dictionary.

Method Details

createXObject

public static PDXObject createXObject(COSBase xobject)
            throws IOException
Create the correct xobject from the cos base.
Parameters:
xobject - The cos level xobject to create.
Returns:
a pdmodel xobject

getCOSObject

public COSBase getCOSObject()
Returns the stream.
Specified by:
getCOSObject in interface COSObjectable

getCOSStream

public COSStream getCOSStream()
Returns the stream.
Returns:
The stream for this object.

getMetadata

public PDMetadata 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.

getPDStream

public PDStream getPDStream()
Returns the stream.
Returns:
The stream for this object.

setMetadata

public void setMetadata(PDMetadata meta)
Set the metadata for this object. This can be null.
Parameters:
meta - The meta data for this object.