Package org.apache.pdfbox.pdfparser
Class FDFParser
- java.lang.Object
-
- org.apache.pdfbox.pdfparser.BaseParser
-
- org.apache.pdfbox.pdfparser.COSParser
-
- org.apache.pdfbox.pdfparser.FDFParser
-
public class FDFParser extends COSParser
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.commons.logging.Log
LOG
-
Fields inherited from class org.apache.pdfbox.pdfparser.COSParser
EOF_MARKER, fileLen, initialParseDone, OBJ_MARKER, securityHandler, source, SYSPROP_EOFLOOKUPRANGE, SYSPROP_PARSEMINIMAL, TMP_FILE_PREFIX, xrefTrailerResolver
-
Fields inherited from class org.apache.pdfbox.pdfparser.BaseParser
A, ASCII_CR, ASCII_LF, B, D, DEF, document, E, ENDOBJ_STRING, ENDSTREAM_STRING, J, M, MAX_LENGTH_LONG, N, O, R, S, seqSource, STREAM_STRING, T
-
-
Constructor Summary
Constructors Constructor Description FDFParser(java.io.File file)
Constructs parser for given file using given buffer for temporary storage.FDFParser(java.io.InputStream input)
Constructor.FDFParser(java.lang.String filename)
Constructs parser for given file using memory buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
init()
private 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.protected boolean
isCatalog(COSDictionary dictionary)
Tell if the dictionary is a FDF catalog.void
parse()
This will parse the stream and populate the COSDocument object.-
Methods inherited from class org.apache.pdfbox.pdfparser.COSParser
checkPages, getAccessPermission, getDocument, getEncryption, getStartxrefOffset, isLenient, lastIndexOf, parseCOSStream, parseDictObjects, parseFDFHeader, parseObjectDynamically, parseObjectDynamically, parsePDFHeader, parseTrailerValuesDynamically, parseXref, parseXrefTable, rebuildTrailer, retrieveTrailer, setEOFLookupRange, setLenient
-
Methods inherited from class org.apache.pdfbox.pdfparser.BaseParser
isClosing, isClosing, isDigit, isDigit, isEndOfName, isEOL, isEOL, isSpace, isSpace, isWhitespace, isWhitespace, parseBoolean, parseCOSArray, parseCOSDictionary, parseCOSName, parseCOSString, parseDirObject, readExpectedChar, readExpectedString, readExpectedString, readGenerationNumber, readInt, readLine, readLong, readObjectNumber, readString, readString, readStringNumber, skipSpaces, skipWhiteSpaces
-
-
-
-
Constructor Detail
-
FDFParser
public FDFParser(java.lang.String filename) throws java.io.IOException
Constructs parser for given file using memory buffer.- Parameters:
filename
- the filename of the pdf to be parsed- Throws:
java.io.IOException
- If something went wrong.
-
FDFParser
public FDFParser(java.io.File file) throws java.io.IOException
Constructs parser for given file using given buffer for temporary storage.- Parameters:
file
- the pdf to be parsed- Throws:
java.io.IOException
- If something went wrong.
-
FDFParser
public FDFParser(java.io.InputStream input) throws java.io.IOException
Constructor.- Parameters:
input
- input stream representing the pdf.- Throws:
java.io.IOException
- If something went wrong.
-
-
Method Detail
-
isCatalog
protected final boolean isCatalog(COSDictionary dictionary)
Tell if the dictionary is a FDF catalog.
-
init
private void init()
-
initialParse
private void initialParse() throws java.io.IOException
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.- Throws:
java.io.IOException
- If something went wrong.
-
parse
public void parse() throws java.io.IOException
This will parse the stream and populate the COSDocument object.- Throws:
java.io.IOException
- If there is an error reading from the stream or corrupt data is found.
-
-