iText 7 7.1.9 API
iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser Class Reference

Parses the page or form XObject content. More...

Public Member Functions

  PdfCanvasParser (PdfTokenizer tokeniser)
  Creates a new instance of PdfContentParser More...
 
  PdfCanvasParser (PdfTokenizer tokeniser, PdfResources currentResources)
  Creates a new instance of PdfContentParser More...
 
virtual IList< PdfObject Parse (IList< PdfObject > ls)
  Parses a single command from the content. More...
 
virtual PdfTokenizer  GetTokeniser ()
  Gets the tokeniser. More...
 
virtual void  SetTokeniser (PdfTokenizer tokeniser)
  Sets the tokeniser. More...
 
virtual PdfDictionary  ReadDictionary ()
  Reads a dictionary. More...
 
virtual PdfArray  ReadArray ()
  Reads an array. More...
 
virtual PdfObject  ReadObject ()
  Reads a pdf object. More...
 
virtual bool  NextValidToken ()
  Reads the next token skipping over the comments. More...
 

Detailed Description

Parses the page or form XObject content.

Paulo Soares

Constructor & Destructor Documentation

◆ PdfCanvasParser() [1/2]

iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.PdfCanvasParser ( PdfTokenizer  tokeniser )
inline

Creates a new instance of PdfContentParser

Parameters
tokeniser the tokeniser with the content

◆ PdfCanvasParser() [2/2]

iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.PdfCanvasParser ( PdfTokenizer  tokeniser,
PdfResources  currentResources 
)
inline

Creates a new instance of PdfContentParser

Parameters
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.

Member Function Documentation

◆ GetTokeniser()

virtual PdfTokenizer iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.GetTokeniser ( )
inlinevirtual

Gets the tokeniser.

Returns
the tokeniser.

◆ NextValidToken()

virtual bool iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.NextValidToken ( )
inlinevirtual

Reads the next token skipping over the comments.

Returns
true if a token was read, false if the end of content was reached

◆ Parse()

virtual IList<PdfObject> iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.Parse ( IList< PdfObject ls )
inlinevirtual

Parses a single command from the content.

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.
A specific behaviour occurs when inline image is encountered (BI command): in that case, parser would continue parsing until it meets EI - end of the inline image; as a result in this case it will return an array with inline image dictionary and image bytes encapsulated in PdfStream object as first element and EI command as second element.

Parameters
ls an ArrayList to use. It will be cleared before using. If it's null will create a new ArrayList
Returns
the same ArrayList given as argument or a new one

◆ ReadArray()

virtual PdfArray iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.ReadArray ( )
inlinevirtual

Reads an array.

Reads an array. The tokeniser must be positioned past the "[" token.

Returns
an array

◆ ReadDictionary()

virtual PdfDictionary iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.ReadDictionary ( )
inlinevirtual

Reads a dictionary.

Reads a dictionary. The tokeniser must be positioned past the "<<" token.

Returns
the dictionary

◆ ReadObject()

virtual PdfObject iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.ReadObject ( )
inlinevirtual

Reads a pdf object.

Returns
the pdf object

◆ SetTokeniser()

virtual void iText.Kernel.Pdf.Canvas.Parser.Util.PdfCanvasParser.SetTokeniser ( PdfTokenizer  tokeniser )
inlinevirtual

Sets the tokeniser.

Parameters
tokeniser the tokeniser