Class PDFParser
java.lang.Object
com.sun.pdfview.BaseWatchable
com.sun.pdfview.PDFParser
PDFParser is the class that parses a PDF content stream and
produces PDFCmds for a PDFPage. You should never ever see it run:
it gets created by a PDFPage only if needed, and may even run in
its own thread.
- Author:
- Mike Wessler
-
Field Summary
FieldsFields inherited from interface Watchable
COMPLETED, ERROR, NEEDS_DATA, NOT_STARTED, PAUSED, RUNNING, STOPPED, UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Cleanup when iteration is donestatic voidvoidstatic voidemitDataFile(byte[] ary, String name) take a byte array and write a temporary file with it's data.static Stringintiterate()parse the stream.static voidsetDebugLevel(int level) voidsetup()Called to prepare for some iterationsMethods inherited from class BaseWatchable
execute, getStatus, go, go, go, go, isExecutable, isFinished, isSuppressSetErrorStackTrace, run, setError, setStatus, setSuppressSetErrorStackTrace, stop, waitForFinish
-
Field Details
-
DEBUG_DCTDECODE_DATA
-
debuglevel
public static int debuglevel
-
-
Constructor Details
-
PDFParser
-
-
Method Details
-
debug
-
escape
-
setDebugLevel
public static void setDebugLevel(int level) -
setup
-
iterate
parse the stream. commands are added to the PDFPage initialized in the constructor as they are encountered.Page numbers in comments refer to the Adobe PDF specification.
commands are listed in PDF spec 32000-1:2008 in Table A.1- Specified by:
iteratein classBaseWatchable- Returns:
- Watchable.RUNNING when there are commands to be processed
- Watchable.COMPLETED when the page is done and all the commands have been processed
- Watchable.STOPPED if the page we are rendering into is no longer available
- Throws:
Exception
-
cleanup
-
dumpStreamToError
public void dumpStreamToError() -
dumpStream
-
emitDataFile
take a byte array and write a temporary file with it's data. This is intended to capture data for analysis, like after decoders.- Parameters:
ary-name-
-