com.sun.pdfview

Class PDFParser

public class PDFParser extends BaseWatchable

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.
Field Summary
static intdebuglevel
Constructor Summary
PDFParser(PDFPage cmds, byte[] stream, HashMap resources)
Don't call this constructor directly.
Method Summary
static voiddebug(String msg, int level)
StringdumpStream()
voiddumpStreamToError()
static Stringescape(String msg)
intiterate()
parse the stream. commands are added to the PDFPage initialized in the constructor as they are encountered.
static voidsetDebugLevel(int level)

Field Detail

debuglevel

public static int debuglevel

Constructor Detail

PDFParser

public PDFParser(PDFPage cmds, byte[] stream, HashMap resources)
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 Detail

debug

public static void debug(String msg, int level)

dumpStream

public String dumpStream()

dumpStreamToError

public void dumpStreamToError()

escape

public static String escape(String msg)

iterate

public int 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.

Returns:

setDebugLevel

public static void setDebugLevel(int level)