Package pdf
Class PDFObject
- java.lang.Object
-
- pdf.PDFObject
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
PDFAnnot,PDFBorder,PDFCatalog,PDFFont,PDFInfo,PDFOutline,PDFPage,PDFPage.procset,PDFPageList,PDFStream
public abstract class PDFObject extends java.lang.Object implements java.io.SerializableThis is the base class for all Objects that form the PDF document.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intobjserThis is the unique serial number for this object.protected PDFDocumentpdfDocumentThis allows any PDF object to refer to the document being constructed.
-
Constructor Summary
Constructors Constructor Description PDFObject(java.lang.String type)This is usually called by extensors to this class, and sets the PDF Object Type
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PDFDocumentgetPDFDocument()Returns the PDF document this object belongs to.intgetSerialID()Returns the unique serial number of this object.java.lang.StringgetType()Returns the PDF Type of this objectstatic java.lang.StringtoArray(java.util.Vector<? extends PDFObject> v)This utility method returns a String containing an array definition based on a Vector containing PDFObjectsjava.lang.StringtoString()Returns the unique serial number in PDF formatabstract voidwrite(java.io.OutputStream os)Writes the object to the output stream.voidwriteEnd(java.io.OutputStream os)The write method should call this after writing anything to the OutputStream.voidwriteStart(java.io.OutputStream os)The write method should call this before writing anything to the OutputStream.
-
-
-
Field Detail
-
objser
protected int objser
This is the unique serial number for this object.
-
pdfDocument
protected PDFDocument pdfDocument
This allows any PDF object to refer to the document being constructed.
-
-
Method Detail
-
getType
public java.lang.String getType()
Returns the PDF Type of this object- Returns:
- The PDF Type of this object
-
getSerialID
public final int getSerialID()
Returns the unique serial number of this object.- Returns:
- Unique serial number of this object.
-
getPDFDocument
public final PDFDocument getPDFDocument()
Returns the PDF document this object belongs to.- Returns:
- PDF containing this object
-
write
public abstract void write(java.io.OutputStream os) throws java.io.IOExceptionWrites 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.
- Parameters:
os- OutputStream to send the object to- Throws:
java.io.IOException- on error
-
writeStart
public final void writeStart(java.io.OutputStream os) throws java.io.IOExceptionThe write method should call this before writing anything to the OutputStream. This will send the standard header for each object.Note: There are a few rare cases where this method is not called.
- Parameters:
os- OutputStream to write to- Throws:
java.io.IOException- on error
-
writeEnd
public final void writeEnd(java.io.OutputStream os) throws java.io.IOExceptionThe write method should call this after writing anything to the OutputStream. This will send the standard footer for each object.Note: There are a few rare cases where this method is not called.
- Parameters:
os- OutputStream to write to- Throws:
java.io.IOException- on error
-
toString
public java.lang.String toString()
Returns the unique serial number in PDF format- Overrides:
toStringin classjava.lang.Object- Returns:
- the serial number in PDF format
-
toArray
public static java.lang.String toArray(java.util.Vector<? extends PDFObject> v)
This utility method returns a String containing an array definition based on a Vector containing PDFObjects- Parameters:
v- Vector containing PDFObjects- Returns:
- String containing a PDF array
-
-