Class PdfDocumentContentParser


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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <E extends IEventListener>
      E
      processContent​(int pageNumber, E renderListener)
      Processes content from the specified page number using the specified listener
      <E extends IEventListener>
      E
      processContent​(int pageNumber, E renderListener, java.util.Map<java.lang.String,​IContentOperator> additionalContentOperators)
      Processes content from the specified page number using the specified listener.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • PdfDocumentContentParser

        public PdfDocumentContentParser​(PdfDocument pdfDocument)
    • Method Detail

      • processContent

        public <E extends IEventListener> E processContent​(int pageNumber,
                                                           E renderListener,
                                                           java.util.Map<java.lang.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 <E extends 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