This is the in-memory representation of the PDF document. You need to call
close() on this object when you are done using it!!
author: Ben Litchfield version: $Revision: 1.28 $
addObject(COSObject obj) This will add an object to this document.
the method checks if obj is already present as there may be cyclic dependencies
Parameters: obj - The object to add to the document.
public void
close() This will close all storage and delete the tmp files.
Constructor that will create a create a scratch file in the
following directory.
Parameters: scratchDir - The directory to store a scratch file. throws: IOException - If there is an error creating the tmp file.
Constructor that will use the following random access file for storage
of the PDF streams. The client of this method is responsible for deleting
the storage if necessary that this file will write to. The close method
will close the file though.
Parameters: file - The random access file to use for storage.
visitor pattern double dispatch method.
Parameters: visitor - The object to notify when visiting this object. any object, depending on the visitor implementation, or null throws: COSVisitorException - If an error occurs while visiting this object.
This will add an object to this document.
the method checks if obj is already present as there may be cyclic dependencies
Parameters: obj - The object to add to the document. The object that was actually added to this document, if an object reference already existed then that will be returned. throws: IOException - If there is an error adding the object.
This method will search the list of objects for types of ObjStm. If it finds
them then it will parse out all of the objects from the stream that is contains.
throws: IOException - If there is an error parsing the stream.
This will get the document catalog.
Maybe this should move to an object at PDFEdit level
catalog is the root of all document activities throws: IOException - If no catalog can be found.
This will get an object from the pool.
Parameters: key - The object key. The object in the pool or a new one if it has not been parsed yet. throws: IOException - If there is an error getting the proxy object.
This will set the encryption dictionary, this should only be called when
encypting the document.
Parameters: encDictionary - The encryption dictionary.
// MIT added, maybe this should not be supported as trailer is a persistence construct.
This will set the document trailer.
Parameters: newTrailer - the document trailer dictionary