Class PdfDocumentContentParser
- java.lang.Object
-
- com.itextpdf.kernel.pdf.canvas.parser.PdfDocumentContentParser
-
public class PdfDocumentContentParser extends java.lang.Object
A utility class that makes it cleaner to process content from pages of aPdfDocument
through a specified RenderListener.
-
-
Field Summary
Fields Modifier and Type Field Description private PdfDocument
pdfDocument
-
Constructor Summary
Constructors Constructor Description PdfDocumentContentParser(PdfDocument pdfDocument)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends IEventListener>
EprocessContent(int pageNumber, E renderListener)
Processes content from the specified page number using the specified listener<E extends IEventListener>
EprocessContent(int pageNumber, E renderListener, java.util.Map<java.lang.String,IContentOperator> additionalContentOperators)
Processes content from the specified page number using the specified listener.
-
-
-
Field Detail
-
pdfDocument
private final PdfDocument pdfDocument
-
-
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 processrenderListener
- the listener that will receive render callbacksadditionalContentOperators
- 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 processrenderListener
- the listener that will receive render callbacks- Returns:
- the provided renderListener
-
-