PDFParser

Overview

PDFParser is a class in Aspose.Pdf FOSS for Java. Inherits from: Closeable.

Full PDF file parser implementing lazy object loading.

Properties

NameTypeAccessDescription
trailerCOSDictionaryReadReturns the trailer dictionary.
versionfloatReadReturns the PDF version (e.g.
catalogCOSDictionaryReadReturns the root catalog dictionary (the value of /Root in the trailer).
allObjectKeysSet<COSObjectKey>ReadReturns all known object keys from the cross-reference table.
encryptedbooleanReadReturns true if this document is encrypted.
decryptorPDFDecryptorReadReturns the active decryptor, if the document was opened successfully with encryption.

Methods

SignatureDescription
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)COSBaseLoads an object by its key (object number + generation number).
getObject(objectNumber: int)COSBaseLoads an object by object number (generation 0).
getTrailer()COSDictionaryReturns the trailer dictionary.
getVersion()floatReturns the PDF version (e.g.
getCatalog()COSDictionaryReturns 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()booleanReturns true if this document is encrypted.
setDecryptor(decryptor: PDFDecryptor)Sets the decryptor directly (for testing).
getDecryptor()PDFDecryptorReturns the active decryptor, if the document was opened successfully with encryption.
resolveReference(obj: COSBase)COSBaseResolves a COS object reference to the actual object.
parseObjectBody()COSBaseParses an object body at the current lexer position.
close()Closes the underlying reader, releasing any associated resources.

See Also