public class PreflightParser
extends org.apache.pdfbox.pdfparser.PDFParser
Constructor and Description |
---|
PreflightParser(File file)
Constructor.
|
PreflightParser(org.apache.pdfbox.io.RandomAccessRead rar)
Constructor.
|
PreflightParser(String filename)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.pdfbox.pdmodel.PDDocument |
createDocument() |
protected void |
initialParse() |
protected int |
lastIndexOf(char[] pattern,
byte[] buf,
int endOff) |
org.apache.pdfbox.pdmodel.PDDocument |
parse() |
org.apache.pdfbox.pdmodel.PDDocument |
parse(Format format)
Parse the given file and check if it is a confirming file according to the given format.
|
org.apache.pdfbox.pdmodel.PDDocument |
parse(Format format,
PreflightConfiguration config)
Parse the given file and check if it is a confirming file according to the given format.
|
protected org.apache.pdfbox.cos.COSArray |
parseCOSArray() |
protected org.apache.pdfbox.cos.COSName |
parseCOSName() |
protected org.apache.pdfbox.cos.COSStream |
parseCOSStream(org.apache.pdfbox.cos.COSDictionary dic)
Wraps the
COSParser.parseCOSStream(org.apache.pdfbox.cos.COSDictionary) to check rules on 'stream' and 'endstream'
keywords. |
protected org.apache.pdfbox.cos.COSString |
parseCOSString()
Check that the hexa string contains only an even number of
Hexadecimal characters.
|
protected org.apache.pdfbox.cos.COSBase |
parseDirObject()
Call
BaseParser.parseDirObject() check limit range for Float, Integer and number of
Dictionary entries. |
protected org.apache.pdfbox.cos.COSBase |
parseObjectDynamically(org.apache.pdfbox.cos.COSObjectKey objKey,
boolean requireExistingNotCompressedObj) |
protected boolean |
parseXrefTable(long startByteOffset)
Same method than the COSParser.parseXrefTable(long) with additional controls : -
EOL mandatory after the 'xref' keyword - Cross reference subsection header uses single white
space as separator - and so on
|
protected boolean |
resetTrailerResolver() |
static ValidationResult |
validate(File file)
Load and validate the given file.
|
checkPages, createRandomAccessReadView, dereferenceCOSObject, getAccessPermission, getEncryption, isLenient, isString, parseFDFHeader, parseObjectStreamObject, parsePDFHeader, prepareDecryption, retrieveTrailer, setEOFLookupRange, setLenient
getObjectKey, isClosing, isClosing, isDigit, isDigit, isEndOfName, isEOF, isEOL, isEOL, isSpace, isSpace, isWhitespace, isWhitespace, parseCOSDictionary, readExpectedChar, readExpectedString, readGenerationNumber, readInt, readLine, readLong, readObjectNumber, readString, readString, readStringNumber, skipSpaces, skipWhiteSpaces
public PreflightParser(File file) throws IOException
file
- IOException
- if there is a reading error.public PreflightParser(org.apache.pdfbox.io.RandomAccessRead rar) throws IOException
rar
- input sourceIOException
- if there is a reading error.public PreflightParser(String filename) throws IOException
filename
- IOException
- if there is a reading error.public org.apache.pdfbox.pdmodel.PDDocument parse() throws IOException
parse
in class org.apache.pdfbox.pdfparser.PDFParser
IOException
public org.apache.pdfbox.pdmodel.PDDocument parse(Format format) throws IOException
format
- format that the document should follow (default Format.PDF_A1B
)IOException
public org.apache.pdfbox.pdmodel.PDDocument parse(Format format, PreflightConfiguration config) throws IOException
format
- format that the document should follow (default Format.PDF_A1B
)config
- Configuration bean that will be used by the PreflightDocument. If null the format is used to determine
the default configuration.IOException
protected org.apache.pdfbox.pdmodel.PDDocument createDocument() throws IOException
createDocument
in class org.apache.pdfbox.pdfparser.PDFParser
IOException
protected void initialParse() throws IOException
initialParse
in class org.apache.pdfbox.pdfparser.PDFParser
IOException
protected boolean resetTrailerResolver()
resetTrailerResolver
in class org.apache.pdfbox.pdfparser.COSParser
protected boolean parseXrefTable(long startByteOffset) throws IOException
parseXrefTable
in class org.apache.pdfbox.pdfparser.COSParser
startByteOffset
- the offset to start atIOException
- If an IO error occurs.protected org.apache.pdfbox.cos.COSStream parseCOSStream(org.apache.pdfbox.cos.COSDictionary dic) throws IOException
COSParser.parseCOSStream(org.apache.pdfbox.cos.COSDictionary)
to check rules on 'stream' and 'endstream'
keywords. checkStreamKeyWord()
and checkEndstreamKeyWord(org.apache.pdfbox.cos.COSDictionary, long)
parseCOSStream
in class org.apache.pdfbox.pdfparser.COSParser
dic
- dictionary that goes with this stream.IOException
- if an error occurred reading the stream, like problems with reading
length attribute, stream does not end with 'endstream' after data read, stream too short etc.protected org.apache.pdfbox.cos.COSArray parseCOSArray() throws IOException
parseCOSArray
in class org.apache.pdfbox.pdfparser.BaseParser
IOException
protected org.apache.pdfbox.cos.COSName parseCOSName() throws IOException
parseCOSName
in class org.apache.pdfbox.pdfparser.BaseParser
IOException
protected org.apache.pdfbox.cos.COSString parseCOSString() throws IOException
BaseParser.parseCOSString()
parseCOSString
in class org.apache.pdfbox.pdfparser.BaseParser
IOException
- If there is an error reading from the stream.protected org.apache.pdfbox.cos.COSBase parseDirObject() throws IOException
BaseParser.parseDirObject()
check limit range for Float, Integer and number of
Dictionary entries.parseDirObject
in class org.apache.pdfbox.pdfparser.BaseParser
IOException
- if there is an error during parsing.protected org.apache.pdfbox.cos.COSBase parseObjectDynamically(org.apache.pdfbox.cos.COSObjectKey objKey, boolean requireExistingNotCompressedObj) throws IOException
parseObjectDynamically
in class org.apache.pdfbox.pdfparser.COSParser
IOException
protected int lastIndexOf(char[] pattern, byte[] buf, int endOff)
lastIndexOf
in class org.apache.pdfbox.pdfparser.COSParser
public static ValidationResult validate(File file) throws IOException
file
- thew file to be read and validatedIOException
- in case of a file reading or parsing errorCopyright © 2002–2025 The Apache Software Foundation. All rights reserved.