public class PdfCanvasParser extends Object
Constructor and Description |
---|
PdfCanvasParser(PdfTokenizer tokeniser)
Creates a new instance of PdfContentParser
|
PdfCanvasParser(PdfTokenizer tokeniser, PdfResources currentResources)
Creates a new instance of PdfContentParser
|
Modifier and Type | Method and Description |
---|---|
PdfTokenizer |
getTokeniser()
Gets the tokeniser.
|
boolean |
nextValidToken()
Reads the next token skipping over the comments.
|
List<PdfObject> |
parse(List<PdfObject> ls)
Parses a single command from the content.
|
PdfArray |
readArray()
Reads an array.
|
PdfDictionary |
readDictionary()
Reads a dictionary.
|
PdfObject |
readObject()
Reads a pdf object.
|
void |
setTokeniser(PdfTokenizer tokeniser)
Sets the tokeniser.
|
public PdfCanvasParser(PdfTokenizer tokeniser)
tokeniser
- the tokeniser with the content
public PdfCanvasParser(PdfTokenizer tokeniser, PdfResources currentResources)
tokeniser
- the tokeniser with the content
currentResources
- current resources of the content stream. It is optional parameter, which is used for performance improvements of specific cases of inline images parsing.
public List<PdfObject> parse(List<PdfObject> ls) throws IOException
ls
- an ArrayList
to use. It will be cleared before using. If it's null
will create a new ArrayList
ArrayList
given as argument or a new one
IOException
- on error
public PdfTokenizer getTokeniser()
public void setTokeniser(PdfTokenizer tokeniser)
tokeniser
- the tokeniser
public PdfDictionary readDictionary() throws IOException
IOException
- on error
public PdfArray readArray() throws IOException
IOException
- on error
public PdfObject readObject() throws IOException
IOException
- on error
public boolean nextValidToken() throws IOException
true
if a token was read, false
if the end of content was reached
IOException
- on error
Copyright © 1998–2022 iText Group NV. All rights reserved.