Class PdfContentParser
java.lang.Object
com.aowagie.text.pdf.PdfContentParser
Parses the page or template content.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intCommands have this type.private PRTokeniserHolds value of property tokeniser. -
Constructor Summary
ConstructorsConstructorDescriptionPdfContentParser(PRTokeniser tokeniser) Creates a new instance of PdfContentParser -
Method Summary
Modifier and TypeMethodDescriptionGets the tokeniser.private booleanReads the next token skipping over the comments.Parses a single command from the content.private PdfArrayReads an array.private PdfDictionaryReads a dictionary.(package private) PdfObjectReads a pdf object.voidsetTokeniser(PRTokeniser tokeniser) Sets the tokeniser.
-
Field Details
-
COMMAND_TYPE
static final int COMMAND_TYPECommands have this type.- See Also:
-
tokeniser
Holds value of property tokeniser.
-
-
Constructor Details
-
PdfContentParser
Creates a new instance of PdfContentParser- Parameters:
tokeniser- the tokeniser with the content
-
-
Method Details
-
parse
Parses a single command from the content. Each command is output as an array of arguments having the command itself as the last element. The returned array will be empty if the end of content was reached.- Parameters:
ls- anArrayListto use. It will be cleared before using. If it'snullwill create a newArrayList- Returns:
- the same
ArrayListgiven as argument or a new one - Throws:
IOException- on error
-
getTokeniser
-
setTokeniser
Sets the tokeniser.- Parameters:
tokeniser- the tokeniser
-
readDictionary
Reads a dictionary. The tokeniser must be positioned past the "<<" token.- Returns:
- the dictionary
- Throws:
IOException- on error
-
readArray
Reads an array. The tokeniser must be positioned past the "[" token.- Returns:
- an array
- Throws:
IOException- on error
-
readPRObject
Reads a pdf object.- Returns:
- the pdf object
- Throws:
IOException- on error
-
nextValidToken
Reads the next token skipping over the comments.- Returns:
trueif a token was read,falseif the end of content was reached- Throws:
IOException- on error
-