inheritFieldAttributes(PjDictionary node) Returns a clone of a field node such that all inherited
attributes of the given field node are made explicit.
Creates a PDF document from an existing PDF file.
Parameters: filename - the name of the PDF file to read. exception: IOException - if an I/O error occurs. exception: PjException - if a PDF error occurs.
Adds a PjObject to a page in this PDF document.
Parameters: page - the page object to add to. Parameters: objectNumber - the object number of the PjObject to add. exception: InvalidPdfObjectException - if an invalid objecttype is encountered.
Appends a PjPage to the end of this PDF document.
Parameters: objectNumber - the object number of the PjPage to append. the new object number of the appended PjPage.
Appends the pages of a PDF document to this document. Note
that this does not clone the other document but simply
includes references to its objects. Therefore the other
document should be discarded immediately after a call to
this method, otherwise you could get very strange results.
Parameters: pdf - the PDF document to append. exception: InvalidPdfObjectException - if an invalid objecttype is encountered in either document.
Deletes a page in this document by page number. The page
is deleted by removing the reference to it from the page
tree; however, no objects are actually deleted from the
document.
Parameters: pageNumber - the page number. Pages are numberedstarting with 1. the object number of the deleted Page object. exception: IndexOutOfBoundsException - if an invalid pagenumber was given. exception: InvalidPdfObjectException - if an invalid objecttype is encountered.
Looks up the Catalog object in this document.
the object number of the Catalog object. exception: InvalidPdfObjectException - if an invalid objecttype is encountered.
Looks up the Encrypt dictionary within this document's trailer.
The Encrypt dictionary contains information for decrypting a
document.
the Encrypt dictionary, or null if no Encrypt field ispresent in the trailer. exception: InvalidPdfObjectException - if the Encrypt field inthe trailer is not a dictionary (PjDictionary) object.
Looks up the Info dictionary within this document's trailer.
The Info dictionary contains general information about the
document.
a reference to the Info dictionary, or null if noInfo field is present in the trailer. exception: InvalidPdfObjectException - if the Info field inthe trailer is not a reference (PjReference) object.
Returns the largest object number in the list of registered
PjObjects. This is useful mainly for functions that need
to run through the list and process each object, because
this provides the maximum object number they need to
examine. The object number may not currently be assigned
to an object, but probably was at some point in the past.
the size of the object list.
Looks up a page in this document by page number.
Parameters: pageNumber - the page number. Pages are numberedstarting with 1. the object number of the identified Page object. exception: IndexOutOfBoundsException - if an invalid pagenumber was given. exception: InvalidPdfObjectException - if an invalid objecttype is encountered.
Determines the number of pages in this PDF document.
the number of pages in this PDF document. exception: InvalidPdfObjectException - if an invalid objecttype is encountered.
Looks up the root Pages object of this document's Pages tree.
the object number of the root Pages object. exception: InvalidPdfObjectException - if an invalid objecttype is encountered.
Returns a clone of a field node such that all inherited
attributes of the given field node are made explicit. For
example, if the V key is not defined in the given field
node, this method ascends the field tree (via the Parent
reference) looking for an ancestor node that does contain a
value for the V key; if it finds one, it assigns that value
in the cloned (returned) field node. This is done for all
inheritable attributes.
Parameters: node - a field node for which inherited attributes areto be retrieved. a cloned copy of the given field node with actualvalues substituted for all inherited attributes. exception: InvalidPdfObjectException - if an invalid objecttype is encountered.
Returns a clone of a pages node such that all inherited
attributes of the given pages node are made explicit. For
example, if MediaBox is not defined in the given pages
node, this method ascends the pages tree (via the Parent
reference) looking for an ancestor node that does contain a
value for MediaBox; if it finds one, it assigns that value
in the cloned (returned) pages node. This is done for all
inheritable attributes.
Parameters: node - a pages node for which inherited attributes areto be retrieved. a cloned copy of the given pages node with actualvalues substituted for all inherited attributes. exception: InvalidPdfObjectException - if an invalid objecttype is encountered.
Registers a PjObject within this PDF document.
Parameters: obj - the PjObject to register. the new object number of the registered PjObject.
registerObject
public void registerObject(PjObject obj, int objectNumber)(Code)
Registers a PjObject within this PDF document using a
specified object number.
Parameters: obj - the PjObject to register. Parameters: objectNumber - the object number to register obj under.
Dereferences a PjObject if it is a PjReference.
Parameters: obj - the PjObject to dereference. the referenced PjObject if obj is a PjReference, or obj otherwise.
Writes this PDF document to a file in PDF format.
Parameters: filename - the name of the PDF file to create. exception: IOException - if an I/O error occurs.