iText 8.0.2 API
iText.Kernel.Pdf.Canvas.Parser.Listener.FilteredEventListener Class Reference

An event listener which filters events on the fly before passing them on to the delegate. More...

Inheritance diagram for iText.Kernel.Pdf.Canvas.Parser.Listener.FilteredEventListener:
iText.Kernel.Pdf.Canvas.Parser.Listener.IEventListener iText.Kernel.Pdf.Canvas.Parser.Listener.FilteredTextEventListener

Public Member Functions

  FilteredEventListener ()
  Constructs a FilteredEventListener empty instance. More...
 
  FilteredEventListener (IEventListener delegate_, params IEventFilter[] filterSet)
  Constructs a FilteredEventListener instance with one delegate. More...
 
virtual T  AttachEventListener< T > (T delegate_, params IEventFilter[] filterSet)
  Attaches another IEventListener delegate with its filters. More...
 
virtual void  EventOccurred (IEventData data, EventType type)
  Called when some event occurs during parsing a content stream. More...
 
virtual ICollection< EventType GetSupportedEvents ()
  Provides the set of event types this listener supports. More...
 

Detailed Description

An event listener which filters events on the fly before passing them on to the delegate.

Constructor & Destructor Documentation

◆ FilteredEventListener() [1/2]

iText.Kernel.Pdf.Canvas.Parser.Listener.FilteredEventListener.FilteredEventListener ( )
inline

Constructs a FilteredEventListener empty instance.

Constructs a FilteredEventListener empty instance. Use AttachEventListener(IEventListener, iText.Kernel.Pdf.Canvas.Parser.Filter.IEventFilter[]) to add an event listener along with its filters.

◆ FilteredEventListener() [2/2]

iText.Kernel.Pdf.Canvas.Parser.Listener.FilteredEventListener.FilteredEventListener ( IEventListener  delegate_,
params IEventFilter[]  filterSet 
)
inline

Constructs a FilteredEventListener instance with one delegate.

Constructs a FilteredEventListener instance with one delegate. Use AttachEventListener(IEventListener, iText.Kernel.Pdf.Canvas.Parser.Filter.IEventFilter[]) to add more IEventListener delegates along with their filters.

Parameters
delegate_ a delegate that will be called when all the corresponding filters for an event pass
filterSet filters attached to the delegate that will be tested before passing an event on to the delegate

Member Function Documentation

◆ AttachEventListener< T >()

virtual T iText.Kernel.Pdf.Canvas.Parser.Listener.FilteredEventListener.AttachEventListener< T > ( delegate_,
params IEventFilter[]  filterSet 
)
inlinevirtual

Attaches another IEventListener delegate with its filters.

Attaches another IEventListener delegate with its filters. When all the filters attached to the delegate for an event accept the event, the event will be passed on to the delegate. You can attach multiple delegates to this FilteredEventListener instance. The content stream will be parsed just once, so it is better for performance than creating multiple FilteredEventListener instances and parsing the content stream multiple times. This is useful, for instance, when you want to extract content from multiple regions of a page.

Template Parameters
T the type of the delegate
Parameters
delegate_ a delegate that will be called when all the corresponding filters for an event pass
filterSet filters attached to the delegate that will be tested before passing an event on to the delegate
Returns
delegate that has been passed to the method, used for convenient call chaining
Type Constraints
T  : IEventListener  

◆ EventOccurred()

virtual void iText.Kernel.Pdf.Canvas.Parser.Listener.FilteredEventListener.EventOccurred ( IEventData  data,
EventType  type 
)
inlinevirtual

Called when some event occurs during parsing a content stream.

Parameters
data Combines the data required for processing corresponding event type.
type Event type.

Implements iText.Kernel.Pdf.Canvas.Parser.Listener.IEventListener.

◆ GetSupportedEvents()

virtual ICollection<EventType> iText.Kernel.Pdf.Canvas.Parser.Listener.FilteredEventListener.GetSupportedEvents ( )
inlinevirtual

Provides the set of event types this listener supports.

Provides the set of event types this listener supports. Returns null if all possible event types are supported.

Returns
Set of event types supported by this listener or null if all possible event types are supported.

Implements iText.Kernel.Pdf.Canvas.Parser.Listener.IEventListener.