public abstract class PDFObject extends Object implements Serializable
Constructor and Description |
---|
PDFObject(String type)
This is usually called by extensors to this class, and sets the PDF Object Type
|
Modifier and Type | Method and Description |
---|---|
int |
getGeneration()
Returns the unique serial number of this object.
|
String |
getName()
Get the name
|
PDFDocument |
getPDFDocument()
Returns the PDF document this object belongs to.
|
int |
getSerialID()
Returns the unique serial number of this object.
|
String |
getType()
Returns the PDF Type of this object
|
void |
setName(String n)
Set the name of this object, for use as a named resource reference in a PDFPage.
|
static String |
toArray(Vector<? extends PDFObject> v)
This utility method returns a String containing an array definition based on a Vector containing PDFObjects
|
String |
toString()
Returns the unique serial number in PDF format
|
abstract void |
write(OutputStream os)
Writes the object to the output stream.
|
void |
writeEnd(OutputStream os)
The write method should call this after writing anything to the OutputStream.
|
void |
writeStart(OutputStream os)
The write method should call this before writing anything to the OutputStream.
|
public PDFObject(String type)
type
- the PDF Object Typepublic String getType()
public void setName(String n)
n
- a String
valuepublic String getName()
String
valuepublic final int getSerialID()
public final int getGeneration()
public final PDFDocument getPDFDocument()
public abstract void write(OutputStream os) throws IOException
Writes the object to the output stream. This method must be overidden.
Note: It should not write any other objects, even if they are it's Kids, as they will be written by the calling routine.
os
- OutputStream to send the object toIOException
- on errorpublic final void writeStart(OutputStream os) throws IOException
Note: There are a few rare cases where this method is not called.
os
- OutputStream to write toIOException
- on errorpublic final void writeEnd(OutputStream os) throws IOException
Note: There are a few rare cases where this method is not called.
os
- OutputStream to write toIOException
- on errorpublic String toString()