Class PdfDocumentContentParser

java.lang.Object
com.itextpdf.kernel.pdf.canvas.parser.PdfDocumentContentParser

public class PdfDocumentContentParser extends Object
A utility class that makes it cleaner to process content from pages of a PdfDocument through a specified RenderListener.
  • Constructor Details

    • PdfDocumentContentParser

      public PdfDocumentContentParser (PdfDocument pdfDocument)
  • Method Details

    • processContent

      public IEventListener> E processContent (int pageNumber, E renderListener, Map<String,IContentOperator> additionalContentOperators)
      Processes content from the specified page number using the specified listener. Also allows registration of custom IContentOperators that can influence how (and whether or not) the PDF instructions will be parsed.
      Type Parameters:
      E - the type of the renderListener - this makes it easy to chain calls
      Parameters:
      pageNumber - the page number to process
      renderListener - the listener that will receive render callbacks
      additionalContentOperators - an optional map of custom ContentOperators for rendering instructions
      Returns:
      the provided renderListener
    • processContent

      public IEventListener> E processContent (int pageNumber, E renderListener)
      Processes content from the specified page number using the specified listener
      Type Parameters:
      E - the type of the renderListener - this makes it easy to chain calls
      Parameters:
      pageNumber - the page number to process
      renderListener - the listener that will receive render callbacks
      Returns:
      the provided renderListener