iText 8.0.2 API
iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor Class Reference

Processor for a PDF content stream. More...

Classes

class   PopGraphicsStateOperator
  A handler that implements operator (Q).
 

Public Member Functions

  PdfCanvasProcessor (IEventListener eventListener)
  Creates a new PDF Content Stream Processor that will send its output to the designated render listener. More...
 
  PdfCanvasProcessor (IEventListener eventListener, IDictionary< String, IContentOperator > additionalContentOperators)
  Creates a new PDF Content Stream Processor that will send its output to the designated render listener. More...
 
virtual IXObjectDoHandler  RegisterXObjectDoHandler (PdfName xobjectSubType, IXObjectDoHandler handler)
  Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing. More...
 
virtual IContentOperator  RegisterContentOperator (String operatorString, IContentOperator @operator)
  Registers a content operator that will be called when the specified operator string is encountered during content processing. More...
 
virtual ICollection< String >  GetRegisteredOperatorStrings ()
  Gets the System.Collections.ICollection containing all the registered operators strings. More...
 
virtual void  Reset ()
  Resets the graphics state stack, matrices and resources. More...
 
virtual ParserGraphicsState  GetGraphicsState ()
  Gets the current ParserGraphicsState More...
 
virtual void  ProcessContent (byte[] contentBytes, PdfResources resources)
  Processes PDF syntax. More...
 
virtual void  ProcessPageContent (PdfPage page)
  Processes PDF syntax. More...
 
virtual IEventListener  GetEventListener ()
  Accessor method for the iText.Kernel.Pdf.Canvas.Parser.Listener.IEventListener object maintained in this class. More...
 

Static Public Attributes

const String  DEFAULT_OPERATOR = "DefaultOperator"
 

Detailed Description

Processor for a PDF content stream.

Constructor & Destructor Documentation

◆ PdfCanvasProcessor() [1/2]

iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.PdfCanvasProcessor ( IEventListener  eventListener )
inline

Creates a new PDF Content Stream Processor that will send its output to the designated render listener.

Parameters
eventListener the iText.Kernel.Pdf.Canvas.Parser.Listener.IEventListener that will receive rendering notifications

◆ PdfCanvasProcessor() [2/2]

iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.PdfCanvasProcessor ( IEventListener  eventListener,
IDictionary< String, IContentOperator additionalContentOperators 
)
inline

Creates a new PDF Content Stream Processor that will send its output to the designated render listener.

Creates a new PDF Content Stream Processor that will send its output to the designated render listener. Also allows registration of custom IContentOperators that can influence how (and whether or not) the PDF instructions will be parsed.

Parameters
eventListener the iText.Kernel.Pdf.Canvas.Parser.Listener.IEventListener that will receive rendering notifications
additionalContentOperators an optional map of custom IContentOperator s for rendering instructions

Member Function Documentation

◆ GetEventListener()

virtual IEventListener iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.GetEventListener ( )
inlinevirtual

Accessor method for the iText.Kernel.Pdf.Canvas.Parser.Listener.IEventListener object maintained in this class.

Accessor method for the iText.Kernel.Pdf.Canvas.Parser.Listener.IEventListener object maintained in this class. Necessary for implementing custom ContentOperator implementations.

Returns
the renderListener

◆ GetGraphicsState()

virtual ParserGraphicsState iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.GetGraphicsState ( )
inlinevirtual

Gets the current ParserGraphicsState

Returns
the current ParserGraphicsState

◆ GetRegisteredOperatorStrings()

virtual ICollection iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.GetRegisteredOperatorStrings ( )
inlinevirtual

Gets the System.Collections.ICollection containing all the registered operators strings.

Returns

System.Collections.ICollection containing all the registered operators strings.

◆ ProcessContent()

virtual void iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.ProcessContent ( byte[]  contentBytes,
PdfResources  resources 
)
inlinevirtual

Processes PDF syntax.

Processes PDF syntax. Note: If you re-use a given PdfCanvasProcessor , you must call Reset()

Parameters
contentBytes the bytes of a content stream
resources the resources of the content stream. Must not be null.

◆ ProcessPageContent()

virtual void iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.ProcessPageContent ( PdfPage  page )
inlinevirtual

Processes PDF syntax.

Processes PDF syntax. Note: If you re-use a given PdfCanvasProcessor , you must call Reset()

Parameters
page the page to process

◆ RegisterContentOperator()

virtual IContentOperator iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.RegisterContentOperator ( String  operatorString,
IContentOperator operator 
)
inlinevirtual

Registers a content operator that will be called when the specified operator string is encountered during content processing.

Registers a content operator that will be called when the specified operator string is encountered during content processing.
If you register an operator, it is a very good idea to pass the call on to the existing registered operator (returned by this call), otherwise you may inadvertently change the internal behavior of the processor.

Parameters
operatorString the operator id, or DEFAULT_OPERATOR for a catch-all operator
operator the operator that will receive notification when the operator is encountered
Returns
the existing registered operator, if any

◆ RegisterXObjectDoHandler()

virtual IXObjectDoHandler iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.RegisterXObjectDoHandler ( PdfName  xobjectSubType,
IXObjectDoHandler  handler 
)
inlinevirtual

Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing.

Registers a Do handler that will be called when Do for the provided XObject subtype is encountered during content processing.
If you register a handler, it is a very good idea to pass the call on to the existing registered handler (returned by this call), otherwise you may inadvertently change the internal behavior of the processor.

Parameters
xobjectSubType the XObject subtype this handler will process, or PdfName.DEFAULT for a catch-all handler
handler the handler that will receive notification when the Do operator for the specified subtype is encountered
Returns
the existing registered handler, if any

◆ Reset()

virtual void iText.Kernel.Pdf.Canvas.Parser.PdfCanvasProcessor.Reset ( )
inlinevirtual

Resets the graphics state stack, matrices and resources.