Package org.xhtmlrenderer.pdf
Class DefaultPDFCreationListener
- java.lang.Object
-
- org.xhtmlrenderer.pdf.DefaultPDFCreationListener
-
- All Implemented Interfaces:
PDFCreationListener
- Direct Known Subclasses:
XHtmlMetaToPdfInfoAdapter
public class DefaultPDFCreationListener extends Object implements PDFCreationListener
No-op implementation of aPDFCreationListener
. Override methods as needed.
-
-
Constructor Summary
Constructors Constructor Description DefaultPDFCreationListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onClose(ITextRenderer renderer)
Called immediately before the iText Document instance is closed, e.g.void
preOpen(ITextRenderer iTextRenderer)
Called immediately after the iText Document instance is created but before the call toDocument.open()
is called.void
preWrite(ITextRenderer iTextRenderer, int pageCount)
Called immediately before the pages of the PDF file are about to be written out.
-
-
-
Method Detail
-
preOpen
public void preOpen(ITextRenderer iTextRenderer)
Description copied from interface:PDFCreationListener
Called immediately after the iText Document instance is created but before the call toDocument.open()
is called. At this point you may still modify certain properties of the PDF document header via thePdfWriter
; once open() is called, you can't change, e.g. the version. See the iText documentation for what limitations there are at this phase of processing.- Specified by:
preOpen
in interfacePDFCreationListener
- Parameters:
iTextRenderer
- the renderer preparing the document
-
preWrite
public void preWrite(ITextRenderer iTextRenderer, int pageCount)
Description copied from interface:PDFCreationListener
Called immediately before the pages of the PDF file are about to be written out. This is an opportunity to modify any document metadata that will be used to generate the PDF header fields (the document information dictionary). Document metadata may be accessed through theITextOutputDevice
that is returned byITextRenderer.getOutputDevice()
.- Specified by:
preWrite
in interfacePDFCreationListener
- Parameters:
iTextRenderer
- the renderer preparing the documentpageCount
- the number of pages that will be written to the PDF document
-
onClose
public void onClose(ITextRenderer renderer)
Description copied from interface:PDFCreationListener
Called immediately before the iText Document instance is closed, e.g. beforecom.itextpdf.text.Document#close()
is called.- Specified by:
onClose
in interfacePDFCreationListener
- Parameters:
renderer
- the iTextRenderer preparing the document
-
-