Package com.itextpdf.kernel.pdf.event
Class AbstractPdfDocumentEventHandler
java.lang.Object
com.itextpdf.kernel.pdf.event.AbstractPdfDocumentEventHandler
- All Implemented Interfaces:
-
IEventHandler
Base class for PDF document events handling based on the event type.
Handles AbstractPdfDocumentEvent
event fired by PdfDocument.dispatchEvent(AbstractPdfDocumentEvent)
. Use PdfDocument.addEventHandler(String, AbstractPdfDocumentEventHandler)
to register this handler for specific type of event.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds new event type to handle by thisAbstractPdfDocumentEventHandler
instance.protected abstract void
Handles the accepted event.void
Handles the event.
-
Constructor Details
-
AbstractPdfDocumentEventHandler
protected AbstractPdfDocumentEventHandler()Creates newAbstractPdfDocumentEventHandler
instance.By default, this instance handles all types of the
AbstractPdfDocumentEvent
events. For specific types handling, useaddType(String)
method.
-
-
Method Details
-
addType
Adds new event type to handle by thisAbstractPdfDocumentEventHandler
instance.- Parameters:
-
type
- theAbstractPdfDocumentEvent
type to handle - Returns:
-
this
AbstractPdfDocumentEventHandler
instance
-
onEvent
Description copied from interface:IEventHandler
Handles the event.- Specified by:
-
onEvent
in interfaceIEventHandler
- Parameters:
-
event
- to handle
-
onAcceptedEvent
Handles the accepted event.- Parameters:
-
event
-AbstractPdfDocumentEvent
to handle
-