Interface PDFCreationListener

    • Method Summary

      All Methods Instance Methods Abstract 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 to Document.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

        void preOpen​(ITextRenderer iTextRenderer)
        Called immediately after the iText Document instance is created but before the call to Document.open() is called. At this point you may still modify certain properties of the PDF document header via the PdfWriter; 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.
        Parameters:
        iTextRenderer - the renderer preparing the document
      • preWrite

        void preWrite​(ITextRenderer iTextRenderer,
                      int pageCount)
        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 the ITextOutputDevice that is returned by ITextRenderer.getOutputDevice().
        Parameters:
        iTextRenderer - the renderer preparing the document
        pageCount - the number of pages that will be written to the PDF document
      • onClose

        void onClose​(ITextRenderer renderer)
        Called immediately before the iText Document instance is closed, e.g. before com.itextpdf.text.Document#close() is called.
        Parameters:
        renderer - the iTextRenderer preparing the document