| Modifier and Type | Field and Description |
|---|---|
| private PreflightConfiguration | |
| private static final Charset | ENCODING
Define a one byte encoding that hasn't specific encoding in UTF-8 charset. |
| private Format | |
| private PreflightDocument | |
| private ValidationResult |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | addValidationError(ValidationResult.
the validation error to be added errorAdd a validation error to the ValidationResult. |
| private void | |
| private void | |
| private long | |
| protected PDDocument | createDocument()
Overrides org. Create the resulting document. |
| protected void | initialParse()
Overrides org. 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. |
| protected int | lastIndexOf(final char[]
pattern to search for pattern, final byte[] buffer to search pattern in buf, final int offset (exclusive) where lookup starts at endOff)Overrides org. Searches last appearance of pattern within buffer. |
| private boolean | |
| public PDDocument | parse()
Overrides org. This will parse the stream and populate the PDDocument object. |
| public PDDocument | parse(Format
format that the document should follow (default format)Format#PDF_A1B)Parse the given file and check if it is a confirming file according to the given format. |
| public PDDocument | parse(Format
format that the document should follow (default format, PreflightConfiguration Format#PDF_A1B)Configuration bean that will be used by the PreflightDocument. If null the format is used to determine
the default configuration. config)Parse the given file and check if it is a confirming file according to the given format. |
| protected COSArray | parseCOSArray()
Overrides org. This will parse a PDF array object. |
| protected COSName | parseCOSName()
Overrides org. This will parse a PDF name from the stream. |
| protected COSStream | Returns: parsed pdf stream.dictionary that goes with this stream. dic)Overrides org. Wraps the |
| protected COSString | Returns: The parsed PDF string.Overrides org. Check that the hexa string contains only an even number of Hexadecimal characters. |
| protected COSBase | Returns: The parsed object.Overrides org. Call |
| private COSBase | parseFileObject(Long offsetOrObjstmObNr, final COSObjectKey objKey)
Hides org.
|
| protected synchronized COSBase | parseObjectDynamically(COSObjectKey
key of object to be parsed objKey, boolean if requireExistingNotCompressedObj)true the object to be parsed must be defined in xref
(comment: null objects may be missing from xref) and it must not be a compressed object within object stream
(this is used to circumvent being stuck in a loop in a malicious PDF)Overrides org. Parse the object for the given object key. |
| protected boolean | Returns: false on parsing errorthe offset to start at startByteOffset)Overrides org. Same method than the PDFParser#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()
Overrides org. Indicates whether the xref trailer resolver should be reset or not. |
| public static ValidationResult |
| config | back to summary |
|---|---|
| private PreflightConfiguration config | |
| ENCODING | back to summary |
|---|---|
| private static final Charset ENCODING Define a one byte encoding that hasn't specific encoding in UTF-8 charset. Avoid unexpected error when the encoding is Cp5816 | |
| format | back to summary |
|---|---|
| private Format format | |
| preflightDocument | back to summary |
|---|---|
| private PreflightDocument preflightDocument | |
| validationResult | back to summary |
|---|---|
| private ValidationResult validationResult | |
| PreflightParser | back to summary |
|---|---|
| public PreflightParser(File file) throws IOException Constructor.
| |
| PreflightParser | back to summary |
|---|---|
| public PreflightParser(RandomAccessRead rar) throws IOException Constructor.
| |
| PreflightParser | back to summary |
|---|---|
| public PreflightParser(String filename) throws IOException Constructor.
| |
| addValidationError | back to summary |
|---|---|
| private void addValidationError(ValidationResult. Add a validation error to the ValidationResult.
| |
| checkEndstreamKeyWord | back to summary |
|---|---|
| private void checkEndstreamKeyWord(COSDictionary dic, long startOffset) throws IOException 'endstream' must be preceded by an EOL | |
| checkPdfHeader | back to summary |
|---|---|
| private void checkPdfHeader() Check that the PDF header match rules of the PDF/A specification. First line (offset 0) must be a comment with the PDF version (version 1.0 isn't conform to the PDF/A specification) Second line is a comment with at least 4 bytes greater than 0x80 | |
| checkStreamKeyWord | back to summary |
|---|---|
| private long checkStreamKeyWord() throws IOException 'stream' must be followed by <CR><LF> or only <LF> | |
| createDocument | back to summary |
|---|---|
| protected PDDocument createDocument() throws IOException Overrides org. Doc from org. Create the resulting document. Maybe overwritten if the parser uses another class as document.
| |
| initialParse | back to summary |
|---|---|
| protected void initialParse() throws IOException Overrides org. Doc from org. 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. It can handle linearized pdfs, which will have an xref at the end pointing to an xref at the beginning of the file. Last the root object is parsed.
| |
| lastIndexOf | back to summary |
|---|---|
| protected int lastIndexOf(final char[] pattern, final byte[] buf, final int endOff) Overrides org. Doc from org. Searches last appearance of pattern within buffer. Lookup before _lastOff and goes back until 0.
| |
| nextIsEOL | back to summary |
|---|---|
| private boolean nextIsEOL() throws IOException | |
| parse | back to summary |
|---|---|
| public PDDocument parse() throws IOException Overrides org. Doc from org. This will parse the stream and populate the PDDocument object. This will close the keystore stream when it is done parsing. Lenient mode is active by default.
| |
| parse | back to summary |
|---|---|
| public PDDocument parse(Format format) throws IOException Parse the given file and check if it is a confirming file according to the given format.
| |
| parse | back to summary |
|---|---|
| public PDDocument parse(Format format, PreflightConfiguration config) throws IOException Parse the given file and check if it is a confirming file according to the given format.
| |
| parseCOSArray | back to summary |
|---|---|
| protected COSArray parseCOSArray() throws IOException Overrides org. Doc from org. This will parse a PDF array object.
| |
| parseCOSName | back to summary |
|---|---|
| protected COSName parseCOSName() throws IOException Overrides org. Doc from org. This will parse a PDF name from the stream.
| |
| parseCOSStream | back to summary |
|---|---|
| protected COSStream parseCOSStream(COSDictionary dic) throws IOException Overrides org. Wraps the
| |
| parseCOSString | back to summary |
|---|---|
| protected COSString parseCOSString() throws IOException Overrides org. Check that the hexa string contains only an even number of
Hexadecimal characters. Once it is done, reset the offset at the beginning of the string and
call
| |
| parseDirObject | back to summary |
|---|---|
| protected COSBase parseDirObject() throws IOException Overrides org. Call
| |
| parseFileObject | back to summary |
|---|---|
| private COSBase parseFileObject(Long offsetOrObjstmObNr, final COSObjectKey objKey) throws IOException Hides org. | |
| parseObjectDynamically | back to summary |
|---|---|
| protected synchronized COSBase parseObjectDynamically(COSObjectKey objKey, boolean requireExistingNotCompressedObj) throws IOException Overrides org. Doc from org. Parse the object for the given object key.
| |
| parseXrefTable | back to summary |
|---|---|
| protected boolean parseXrefTable(long startByteOffset) throws IOException Overrides org. Same method than the PDFParser#parseXrefTable(long) with additional controls : - EOL mandatory after the 'xref' keyword - Cross reference subsection header uses single white space as separator - and so on
| |
| resetTrailerResolver | back to summary |
|---|---|
| protected boolean resetTrailerResolver() Overrides org. Doc from org. Indicates whether the xref trailer resolver should be reset or not. Should be overwritten if the xref trailer resolver is needed after the initial parsing.
| |
| validate | back to summary |
|---|---|
| public static ValidationResult validate(File file) throws IOException Load and validate the given file. Returns the validation result and closes the read pdf.
| |