PDFParser
Overview
PDFParser is a class in Aspose.Pdf FOSS for Java.
Inherits from: Closeable.
Full PDF file parser implementing lazy object loading.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
trailer | COSDictionary | Read | Returns the trailer dictionary. |
version | float | Read | Returns the PDF version (e.g. |
catalog | COSDictionary | Read | Returns the root catalog dictionary (the value of /Root in the trailer). |
allObjectKeys | Set<COSObjectKey> | Read | Returns all known object keys from the cross-reference table. |
encrypted | boolean | Read | Returns true if this document is encrypted. |
decryptor | PDFDecryptor | Read | Returns the active decryptor, if the document was opened successfully with encryption. |
Methods
| Signature | Description |
|---|---|
PDFParser(reader: RandomAccessReader) | Constructs a new PDFParser for the given source. |
parse() | Processes the document structure: header, cross-reference table, and trailer. |
getObject(key: COSObjectKey) → COSBase | Loads an object by its key (object number + generation number). |
getObject(objectNumber: int) → COSBase | Loads an object by object number (generation 0). |
getTrailer() → COSDictionary | Returns the trailer dictionary. |
getVersion() → float | Returns the PDF version (e.g. |
getCatalog() → COSDictionary | Returns the root catalog dictionary (the value of /Root in the trailer). |
getAllObjectKeys() → Set<COSObjectKey> | Returns all known object keys from the cross-reference table. |
initSecurity(password: byte[]) | Initializes decryption if the PDF is encrypted. |
initSecurity(password: byte[], customHandler: ICustomSecurityHandler) | Initializes decryption if the PDF is encrypted. |
isEncrypted() → boolean | Returns true if this document is encrypted. |
setDecryptor(decryptor: PDFDecryptor) | Sets the decryptor directly (for testing). |
getDecryptor() → PDFDecryptor | Returns the active decryptor, if the document was opened successfully with encryption. |
resolveReference(obj: COSBase) → COSBase | Resolves a COS object reference to the actual object. |
parseObjectBody() → COSBase | Parses an object body at the current lexer position. |
close() | Closes the underlying reader, releasing any associated resources. |