public class PDFObject
extends java.lang.Object
PDFObject is the superclass of these simple objects. A PDFObject cannot be directly instantiated, but any of its subclasses may.
Any PDFObject may be either direct or indirect. A direct object exists within its collection object (such as a PDFArray) and can be referenced only within that collection object. An indirect object exists outside of any collection object and can be referenced by many collection objects.
| Modifier and Type | Method and Description |
|---|---|
PDFObject |
clone()
Makes a new copy of this PDFObject in memory, in the same document and using same direct/indirect setting as this PDFObject.
|
PDFObject |
clone(Document doc)
Makes a new copy of this PDFObject in memory, in the supplied document, using the same direct/indirect setting as this PDFObject.
|
PDFObject |
clone(Document doc,
boolean indirect)
Makes a new copy of this PDFObject in memory, in the supplied document, using supplied direct/indirect setting.
|
PDFObject |
clone(PDFObject obj)
Makes a new copy of this PDFObject in memory, in the same document as another object, using the same direct/indirect setting as this PDFObject.
|
PDFObject |
clone(PDFObject obj,
boolean indirect)
Makes a new copy of this PDFObject in memory, in the same document as another object, using supplied direct/indirect setting.
|
PDFObjectComparison |
compareTo(PDFObject rhs)
Compares this object to another object.
|
void |
delete() |
void |
destroy()
Destroys this object.
|
boolean |
enumPDFObjects(PDFObjectEnumProc enumProc)
Enumerates the elements of a PDFObject by calling a user-supplied procedure for each component of the object.
|
boolean |
equals(java.lang.Object rhs) |
Document |
getDocument()
The Document of which this object is a member.
|
int |
getGeneration()
The generation number for this object.
|
int |
getID()
The ID number for this object.
|
boolean |
getIndirect()
Indicates if this object is indirect or direct.
|
int |
getPDFHashValue()
The 32-bit hash value for this object.
|
java.lang.String |
toString() |
public void delete()
public boolean equals(java.lang.Object rhs)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean getIndirect()
public int getGeneration()
public int getID()
public PDFObject clone()
clone in class java.lang.Objectpublic PDFObject clone(Document doc)
public PDFObject clone(Document doc, boolean indirect)
public PDFObject clone(PDFObject obj)
public PDFObject clone(PDFObject obj, boolean indirect)
public void destroy()
This method does nothing if this object is a direct scalar object.
If a composite object (an array, dictionary or stream) is destroyed:
All the direct objects in it are automatically destroyed.
The indirect objects in it are not destroyed.
public PDFObjectComparison compareTo(PDFObject rhs)
The result is valid only within a single instance of the document.
rhs - the other PDFObject to compare.public int getPDFHashValue()
public Document getDocument()
Returns null if the Document is not known by PDFL, or if it is a temporary document.
If the Document is not null, then it shares the same internal data with other Document objects that refer to the same file. Document objects returned this way do not contribute to the internal count that keeps the Document open, and will become invalid if the main reference to the document is disposed.
public boolean enumPDFObjects(PDFObjectEnumProc enumProc)
For scalars or strings, the proc is not called, and CosObjEnum() returns true.
For dictionaries, proc is called for each key-value pair. The order in which the key-value pairs are enumerated is undefined.
For arrays, proc is called with each element as the first paramater to proc, and the NULL object as the second parameter. Array elements are enumerated in ascending order of index.
For streams, proc is called once, with the stream's dictionary as the first parameter to the proc and the NULL object as the second parameter.
enumProc - A user-supplied callback to call for each element of the object. of obj. Neither proc nor any routine called by proc may modify the object. Doing so can produce undefined results or errors. For example, if the object is an array, enumProc must not call Remove(); if the object is a dictionary, enumProc must not call Put().