| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final COSDocumentState | |
| private boolean | |
| private long | highestXRefObjectNumber
Used for incremental saving, to avoid XRef object numbers from being reused. |
| private boolean | isDecrypted
Signal that document is already decrypted. |
| private boolean | |
| private static final Log | LOG
Log instance. |
| private final Map | objectPool
Maps ObjectKeys to a COSObject. |
| private final ICOSParser | |
| private long | |
| private final RandomAccessStreamCache | |
| private final List | streams
List containing all streams which are created when creating a new pdf. |
| private COSDictionary | trailer
Document trailer dictionary. |
| private float | |
| private final Map | xrefTable
Maps object and generation id to object byte offsets. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | COSDocument(RandomAccessStreamCache.
a function to create an instance of a stream cache streamCacheCreateFunctionConstructor that will use the provided function to create a stream cache for the storage of the PDF streams. |
| public | COSDocument(RandomAccessStreamCache.
a function to create an instance of a stream cache streamCacheCreateFunction,Parser to be used to parse the document on demand parser)Constructor that will use the provided function to create a stream cache for the storage of the PDF streams. |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(ICOSVisitor
The object to notify when visiting this object. visitor)Implements abstract org. visitor pattern double dispatch method. |
| public void | addXRefTable(Map<COSObjectKey, Long>
xref table entries to be added xrefTableValues)Populate XRef HashMap with given values. |
| public void | |
| public COSStream | Returns: the new COSStreamCreates a new COSStream using the current configuration for scratch files. |
| public COSStream | Returns: the new COSStreamthe corresponding dictionary dictionary, long the start position within the source startPosition, long the stream length streamLength)Creates a new COSStream using the current configuration for scratch files. |
| public COSArray | |
| public COSDocumentState | |
| public COSDictionary | Returns: The encryption dictionary.This will get the encryption dictionary if the document is encrypted or null if the document is not encrypted. |
| public long | Returns: The object number of the highest XRef stream, or 0 if there was no XRef stream.Internal PDFBox use only. |
| public COSDictionary | Returns: the dictionary containing the linearization informationGet the dictionary containing the linearization information if the pdf is linearized. |
| public COSObject | Returns: The object in the pool or a new one if it has not been parsed yet.The object key. key)This will get an object from the pool. |
| public List | Returns: This will return all objects with the specified type.The type of the object. type)This will get all dictionaries objects by type. |
| public List | Returns: This will return all objects with the specified type(s).The first possible type of the object, mandatory. type1, COSName The second possible type of the object, usually an abbreviation, optional. type2)This will get all dictionaries objects by type. |
| private List | |
| public long | Returns: a long with the old position of the startxrefReturn the startXref Position of the parsed document. |
| private RandomAccessStreamCache | |
| public COSDictionary | |
| public float | Returns: The header version.This will get the version extracted from the header of this PDF document. |
| public Map | Returns: mapping of ObjectsKeys to byte offsetsReturns the xrefTable which is a mapping of ObjectKeys to byte offsets in the file. |
| public boolean | Returns: true if the pdf has hybrid cross referencesDetermines if the pdf has hybrid cross references, both plain tables and streams. |
| public boolean | Returns: true if the document is already closed, false otherwiseReturns true if this document has been closed. |
| public boolean | Returns: true indicates that the pdf is decrypted.Indicates if a encrypted pdf is already decrypted after parsing. |
| public boolean | Returns: true If this document is encrypted.This will tell if this is an encrypted document. |
| public boolean | Returns: true if the trailer is a XRef streamDetermines if the trailer is a XRef stream or not. |
| public void | |
| public void | setDocumentID(COSArray
The document id. id)This will set the document ID. This should be an array of two strings. |
| public void | setEncryptionDictionary(COSDictionary
The encryption dictionary. encDictionary)This will set the encryption dictionary, this should only be called when encrypting the document. |
| public void | |
| public void | setHighestXRefObjectNumber(long
The object number of the highest XRef stream. highestXRefObjectNumber)Internal PDFBox use only. |
| public void | setIsXRefStream(boolean
the new value for isXRefStream isXRefStreamValue)Sets isXRefStream to the given value. |
| public void | setStartXref(long
the value for startXref startXrefValue)This method set the startxref value of the document. |
| public void | setTrailer(COSDictionary
the document trailer dictionary newTrailer)// MIT added, maybe this should not be supported as trailer is a persistence construct. |
| public void | setVersion(float
The version of the PDF document. versionValue)This will set the header version of this PDF document. |
| closed | back to summary |
|---|---|
| private boolean closed | |
| documentState | back to summary |
|---|---|
| private final COSDocumentState documentState | |
| hasHybridXRef | back to summary |
|---|---|
| private boolean hasHybridXRef | |
| highestXRefObjectNumber | back to summary |
|---|---|
| private long highestXRefObjectNumber Used for incremental saving, to avoid XRef object numbers from being reused. | |
| isDecrypted | back to summary |
|---|---|
| private boolean isDecrypted Signal that document is already decrypted. | |
| isXRefStream | back to summary |
|---|---|
| private boolean isXRefStream | |
| LOG | back to summary |
|---|---|
| private static final Log LOG Log instance. | |
| objectPool | back to summary |
|---|---|
| private final Map<COSObjectKey, COSObject> objectPool Maps ObjectKeys to a COSObject. Note that references to these objects are also stored in COSDictionary objects that map a name to a specific object. | |
| parser | back to summary |
|---|---|
| private final ICOSParser parser | |
| startXref | back to summary |
|---|---|
| private long startXref | |
| streamCache | back to summary |
|---|---|
| private final RandomAccessStreamCache streamCache | |
| streams | back to summary |
|---|---|
| private final List<COSStream> streams List containing all streams which are created when creating a new pdf. | |
| trailer | back to summary |
|---|---|
| private COSDictionary trailer Document trailer dictionary. | |
| version | back to summary |
|---|---|
| private float version | |
| xrefTable | back to summary |
|---|---|
| private final Map<COSObjectKey, Long> xrefTable Maps object and generation id to object byte offsets. | |
| COSDocument | back to summary |
|---|---|
| public COSDocument() Constructor. Uses main memory to buffer PDF streams. | |
| COSDocument | back to summary |
|---|---|
| public COSDocument(ICOSParser parser) Constructor. Uses main memory to buffer PDF streams.
| |
| COSDocument | back to summary |
|---|---|
| public COSDocument(RandomAccessStreamCache. Constructor that will use the provided function to create a stream cache for the storage of the PDF streams.
| |
| COSDocument | back to summary |
|---|---|
| public COSDocument(RandomAccessStreamCache. Constructor that will use the provided function to create a stream cache for the storage of the PDF streams.
| |
| accept | back to summary |
|---|---|
| public void accept(ICOSVisitor visitor) throws IOException Implements abstract org. visitor pattern double dispatch method.
| |
| addXRefTable | back to summary |
|---|---|
| public void addXRefTable(Map<COSObjectKey, Long> xrefTableValues) Populate XRef HashMap with given values. Each entry maps ObjectKeys to byte offsets in the file.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. This will close all storage and delete the tmp files.
| |
| createCOSStream | back to summary |
|---|---|
| public COSStream createCOSStream() Creates a new COSStream using the current configuration for scratch files.
| |
| createCOSStream | back to summary |
|---|---|
| public COSStream createCOSStream(COSDictionary dictionary, long startPosition, long streamLength) throws IOException Creates a new COSStream using the current configuration for scratch files. Not for public use. Only COSParser should call this method.
| |
| getDocumentID | back to summary |
|---|---|
| public COSArray getDocumentID() This will get the document ID.
| |
| getDocumentState | back to summary |
|---|---|
| public COSDocumentState getDocumentState() Returns the
| |
| getEncryptionDictionary | back to summary |
|---|---|
| public COSDictionary getEncryptionDictionary() This will get the encryption dictionary if the document is encrypted or null if the document is not encrypted.
| |
| getHighestXRefObjectNumber | back to summary |
|---|---|
| public long getHighestXRefObjectNumber() Internal PDFBox use only. Get the object number of the highest XRef stream. This is needed to avoid reusing such a number in incremental saving.
| |
| getLinearizedDictionary | back to summary |
|---|---|
| public COSDictionary getLinearizedDictionary() Get the dictionary containing the linearization information if the pdf is linearized.
| |
| getObjectFromPool | back to summary |
|---|---|
| public COSObject getObjectFromPool(COSObjectKey key) This will get an object from the pool.
| |
| getObjectsByType | back to summary |
|---|---|
| public List This will get all dictionaries objects by type. | |
| getObjectsByType | back to summary |
|---|---|
| public List This will get all dictionaries objects by type. | |
| getObjectsByType | back to summary |
|---|---|
| private List | |
| getStartXref | back to summary |
|---|---|
| public long getStartXref() Return the startXref Position of the parsed document. This will only be needed for incremental updates.
| |
| getStreamCache | back to summary |
|---|---|
| private RandomAccessStreamCache getStreamCache(RandomAccessStreamCache. | |
| getTrailer | back to summary |
|---|---|
| public COSDictionary getTrailer() This will get the document trailer.
| |
| getVersion | back to summary |
|---|---|
| public float getVersion() This will get the version extracted from the header of this PDF document.
| |
| getXrefTable | back to summary |
|---|---|
| public Map Returns the xrefTable which is a mapping of ObjectKeys to byte offsets in the file.
| |
| hasHybridXRef | back to summary |
|---|---|
| public boolean hasHybridXRef() Determines if the pdf has hybrid cross references, both plain tables and streams.
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Returns true if this document has been closed.
| |
| isDecrypted | back to summary |
|---|---|
| public boolean isDecrypted() Indicates if a encrypted pdf is already decrypted after parsing.
| |
| isEncrypted | back to summary |
|---|---|
| public boolean isEncrypted() This will tell if this is an encrypted document.
| |
| isXRefStream | back to summary |
|---|---|
| public boolean isXRefStream() Determines if the trailer is a XRef stream or not.
| |
| setDecrypted | back to summary |
|---|---|
| public void setDecrypted() Signals that the document is decrypted completely. | |
| setDocumentID | back to summary |
|---|---|
| public void setDocumentID(COSArray id) This will set the document ID. This should be an array of two strings. This method cannot be
used to remove the document id by passing null or an empty array; it will be recreated. Only
the first existing string is used when writing, the second one is always recreated. If you
don't want this, you'll have to modify the
| |
| setEncryptionDictionary | back to summary |
|---|---|
| public void setEncryptionDictionary(COSDictionary encDictionary) This will set the encryption dictionary, this should only be called when encrypting the document.
| |
| setHasHybridXRef | back to summary |
|---|---|
| public void setHasHybridXRef() Marks the pdf as document using hybrid cross references. | |
| setHighestXRefObjectNumber | back to summary |
|---|---|
| public void setHighestXRefObjectNumber(long highestXRefObjectNumber) Internal PDFBox use only. Sets the object number of the highest XRef stream. This is needed to avoid reusing such a number in incremental saving.
| |
| setIsXRefStream | back to summary |
|---|---|
| public void setIsXRefStream(boolean isXRefStreamValue) Sets isXRefStream to the given value. You need to take care that the version of your PDF is 1.5 or higher.
| |
| setStartXref | back to summary |
|---|---|
| public void setStartXref(long startXrefValue) This method set the startxref value of the document. This will only be needed for incremental updates.
| |
| setTrailer | back to summary |
|---|---|
| public void setTrailer(COSDictionary newTrailer) // MIT added, maybe this should not be supported as trailer is a persistence construct. This will set the document trailer.
| |
| setVersion | back to summary |
|---|---|
| public void setVersion(float versionValue) This will set the header version of this PDF document.
| |