Package com.pd4ml.pdf.cos.parser
Class COSParser
- java.lang.Object
-
- com.pd4ml.pdf.cos.parser.COSParser
-
public final class COSParser extends java.lang.ObjectA low level, recursive-descent parser that turns the raw bytes of a PDF file into a populatedCOSDocument: every indirect object, the cross-reference table (classic tables, cross-reference streams, hybrid files, incremental updates via/Prev, and compressed objects held in object streams), and the trailer.If the cross-reference information is missing, points at garbage, or forms a broken chain,
parse()falls back to a brute-force linear scan for"n g obj"headers, the same recovery strategy used by essentially every real-world PDF reader to cope with the very common case of a corrupt or non-conformant xref section.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static COSDocumentload(byte[] pdfBytes)static COSDocumentload(byte[] pdfBytes, java.lang.String password)Likeload(byte[]), for a document protected by the PDF Standard security handler.COSDocumentparse()
-
-
-
Method Detail
-
load
public static COSDocument load(byte[] pdfBytes) throws COSParseException
- Throws:
COSParseException
-
load
public static COSDocument load(byte[] pdfBytes, java.lang.String password) throws COSParseException
Likeload(byte[]), for a document protected by the PDF Standard security handler.- Throws:
COSParseException
-
parse
public COSDocument parse() throws COSParseException
- Throws:
COSParseException
-
-