Package org.loboevolution.pdfview
Class PDFParser
java.lang.Object
org.loboevolution.pdfview.BaseWatchable
org.loboevolution.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
Fields inherited from interface org.loboevolution.pdfview.Watchable
COMPLETED, ERROR, NEEDS_DATA, NOT_STARTED, PAUSED, RUNNING, STOPPED, UNKNOWN
-
Constructor Summary
-
Method Summary
Methods inherited from class org.loboevolution.pdfview.BaseWatchable
execute, getErrorHandler, getStatus, go, go, go, go, isExecutable, isFinished, run, setError, stop, waitForFinish
-
Constructor Details
-
PDFParser
Don't call this constructor directly. Instead, use PDFFile.getPage(int pagenum) to get a PDFPage. There should never be any reason for a user to create, access, or hold on to a PDFParser.
-
-
Method Details
-
setup
public void setup()Prepare for a set of iterations. Called before the first iterate() call in a sequence. Subclasses should extend this method if they need to do anything to setup.Called to prepare for some iterations
- Overrides:
setup
in classBaseWatchable
-
iterate
Perform a single iteration of this watchable. This is the minimum granularity which the go() commands operate over.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:
iterate
in classBaseWatchable
- Returns:
- one of three values:
- Watchable.RUNNING if there is still data to be processed
- Watchable.NEEDS_DATA if there is no data to be processed but the execution is not yet complete
- Watchable.COMPLETED if the execution is complete
- Throws:
Exception
- if any.
-
cleanup
public void cleanup()Clean up after a set of iterations. Called after iteration has stopped due to completion, manual stopping, or error.Cleanup when iteration is done
- Overrides:
cleanup
in classBaseWatchable
-
setStatus
protected void setStatus(int status) Set the status of this watchable- Overrides:
setStatus
in classBaseWatchable
- Parameters:
status
- aInteger
object.
-