public class PDFParser extends COSParser
EOF_MARKER, fileLen, initialParseDone, OBJ_MARKER, securityHandler, SYSPROP_EOFLOOKUPRANGE, xrefTrailerResolverA, ASCII_CR, ASCII_LF, B, D, DEF, document, E, ENDOBJ_STRING, ENDSTREAM_STRING, J, M, N, O, R, S, source, STREAM_STRING, T| Constructor and Description |
|---|
PDFParser(org.apache.pdfbox.io.RandomAccessRead source)
Constructor.
|
PDFParser(org.apache.pdfbox.io.RandomAccessRead source,
String decryptionPassword)
Constructor.
|
PDFParser(org.apache.pdfbox.io.RandomAccessRead source,
String decryptionPassword,
InputStream keyStore,
String alias)
Constructor.
|
PDFParser(org.apache.pdfbox.io.RandomAccessRead source,
String decryptionPassword,
InputStream keyStore,
String alias,
org.apache.pdfbox.io.RandomAccessStreamCache.StreamCacheCreateFunction streamCacheCreateFunction)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected PDDocument |
createDocument()
Create the resulting document.
|
protected void |
initialParse()
The initial parse will first parse only the trailer, the xrefstart and all xref tables to have a pointer (offset)
to all the pdf's objects.
|
static PDDocument |
load(File file)
Deprecated.
use
Loader.loadPDF(File) instead |
static PDDocument |
load(File file,
String password)
Deprecated.
use
Loader.loadPDF(File, String) instead |
PDDocument |
parse()
This will parse the stream and populate the PDDocument object.
|
PDDocument |
parse(boolean lenient)
This will parse the stream and populate the PDDocument object.
|
checkPages, createRandomAccessReadView, dereferenceCOSObject, getAccessPermission, getEncryption, isLenient, isString, lastIndexOf, parseCOSStream, parseFDFHeader, parseObjectDynamically, parseObjectStreamObject, parsePDFHeader, parseXrefTable, prepareDecryption, resetTrailerResolver, retrieveTrailer, setEOFLookupRange, setLenientgetObjectKey, isClosing, isClosing, isDigit, isDigit, isEndOfName, isEOF, isEOL, isEOL, isSpace, isSpace, isWhitespace, isWhitespace, parseCOSArray, parseCOSDictionary, parseCOSName, parseCOSString, parseDirObject, readExpectedChar, readExpectedString, readGenerationNumber, readInt, readLine, readLong, readObjectNumber, readString, readString, readStringNumber, skipSpaces, skipWhiteSpacespublic PDFParser(org.apache.pdfbox.io.RandomAccessRead source)
throws IOException
source - source representing the pdf.IOException - If something went wrong.public PDFParser(org.apache.pdfbox.io.RandomAccessRead source,
String decryptionPassword)
throws IOException
source - input representing the pdf.decryptionPassword - password to be used for decryption.IOException - If something went wrong.public PDFParser(org.apache.pdfbox.io.RandomAccessRead source,
String decryptionPassword,
InputStream keyStore,
String alias)
throws IOException
source - input representing the pdf.decryptionPassword - password to be used for decryption.keyStore - key store to be used for decryption when using public key securityalias - alias to be used for decryption when using public key securityIOException - If something went wrong.public PDFParser(org.apache.pdfbox.io.RandomAccessRead source,
String decryptionPassword,
InputStream keyStore,
String alias,
org.apache.pdfbox.io.RandomAccessStreamCache.StreamCacheCreateFunction streamCacheCreateFunction)
throws IOException
source - input representing the pdf.decryptionPassword - password to be used for decryption.keyStore - key store to be used for decryption when using public key securityalias - alias to be used for decryption when using public key securitystreamCacheCreateFunction - a function to create an instance of the stream cacheIOException - If something went wrong.protected void initialParse()
throws IOException
InvalidPasswordException - If the password is incorrect.IOException - If something went wrong.public PDDocument parse() throws IOException
InvalidPasswordException - If the password is incorrect.IOException - If there is an error reading from the stream or corrupt data is found.public PDDocument parse(boolean lenient) throws IOException
lenient - activate leniency if set to trueInvalidPasswordException - If the password is incorrect.IOException - If there is an error reading from the stream or corrupt data is found.protected PDDocument createDocument() throws IOException
IOException - if the method is called before parsing the document@Deprecated public static PDDocument load(File file) throws IOException
Loader.loadPDF(File) insteadfile - file to be loadedInvalidPasswordException - If the file required a non-empty password.IOException - in case of a file reading or parsing error@Deprecated public static PDDocument load(File file, String password) throws IOException
Loader.loadPDF(File, String) insteadfile - file to be loadedpassword - password to be used for decryptionInvalidPasswordException - If the password is incorrect.IOException - in case of a file reading or parsing errorCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.