|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pdfbox.pdfparser.BaseParser
org.apache.pdfbox.pdfparser.PDFParser
public class PDFParser
This class will handle the parsing of the PDF document.
Field Summary |
---|
Fields inherited from class org.apache.pdfbox.pdfparser.BaseParser |
---|
DEF, document, ENDOBJ, ENDSTREAM, FORCE_PARSING, forceParsing, pdfSource |
Constructor Summary | |
---|---|
PDFParser(java.io.InputStream input)
Constructor. |
|
PDFParser(java.io.InputStream input,
RandomAccess rafi)
Constructor to allow control over RandomAccessFile. |
|
PDFParser(java.io.InputStream input,
RandomAccess rafi,
boolean force)
Constructor to allow control over RandomAccessFile. |
Method Summary | |
---|---|
COSDocument |
getDocument()
This will get the document that was parsed. |
FDFDocument |
getFDFDocument()
This will get the FDF document that was parsed. |
PDDocument |
getPDDocument()
This will get the PD document that was parsed. |
protected boolean |
isContinueOnError(java.lang.Exception e)
Returns true if parsing should be continued. |
void |
parse()
This will parse the stream and populate the COSDocument object. |
void |
parseXrefStream(COSStream stream,
int objByteOffset)
Fills XRefTrailerResolver with data of given stream. |
void |
setTempDirectory(java.io.File tmpDir)
This is the directory where pdfbox will create a temporary file for storing pdf document stream in. |
Methods inherited from class org.apache.pdfbox.pdfparser.BaseParser |
---|
isClosing, isClosing, isEndOfName, isEOL, isEOL, isWhitespace, isWhitespace, parseBoolean, parseCOSArray, parseCOSDictionary, parseCOSName, parseCOSStream, parseCOSString, parseDirObject, readExpectedString, readInt, readLine, readString, readString, setDocument, skipSpaces |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDFParser(java.io.InputStream input) throws java.io.IOException
input
- The input stream that contains the PDF document.
java.io.IOException
- If there is an error initializing the stream.public PDFParser(java.io.InputStream input, RandomAccess rafi) throws java.io.IOException
input
- The input stream that contains the PDF document.rafi
- The RandomAccessFile to be used in internal COSDocument
java.io.IOException
- If there is an error initializing the stream.public PDFParser(java.io.InputStream input, RandomAccess rafi, boolean force) throws java.io.IOException
input
- The input stream that contains the PDF document.rafi
- The RandomAccessFile to be used in internal COSDocumentforce
- When true, the parser will skip corrupt pdf objects and
will continue parsing at the next object in the file
java.io.IOException
- If there is an error initializing the stream.Method Detail |
---|
public void setTempDirectory(java.io.File tmpDir)
tmpDir
- The directory to create scratch files needed to store
pdf document streams.protected boolean isContinueOnError(java.lang.Exception e)
e
- The exception if vailable. Can be null if there is no exception availablepublic void parse() throws java.io.IOException
java.io.IOException
- If there is an error reading from the stream or corrupt data
is found.public COSDocument getDocument() throws java.io.IOException
java.io.IOException
- If there is an error getting the document.public PDDocument getPDDocument() throws java.io.IOException
java.io.IOException
- If there is an error getting the document.public FDFDocument getFDFDocument() throws java.io.IOException
java.io.IOException
- If there is an error getting the document.public void parseXrefStream(COSStream stream, int objByteOffset) throws java.io.IOException
stream
- the stream to be readobjByteOffset
- the offset to start at
java.io.IOException
- if there is an error parsing the stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |