Package com.itextpdf.text.pdf.parser
Class PdfReaderContentParser
- java.lang.Object
-
- com.itextpdf.text.pdf.parser.PdfReaderContentParser
-
public class PdfReaderContentParser extends java.lang.Object
A utility class that makes it cleaner to process content from pages of a PdfReader through a specified RenderListener.- Since:
- 5.0.2
-
-
Constructor Summary
Constructors Constructor Description PdfReaderContentParser(PdfReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends RenderListener>
EprocessContent(int pageNumber, E renderListener)
Processes content from the specified page number using the specified listener<E extends RenderListener>
EprocessContent(int pageNumber, E renderListener, java.util.Map<java.lang.String,ContentOperator> additionalContentOperators)
Processes content from the specified page number using the specified listener.
-
-
-
Field Detail
-
reader
private final PdfReader reader
the reader this parser will process
-
-
Constructor Detail
-
PdfReaderContentParser
public PdfReaderContentParser(PdfReader reader)
-
-
Method Detail
-
processContent
public <E extends RenderListener> E processContent(int pageNumber, E renderListener, java.util.Map<java.lang.String,ContentOperator> additionalContentOperators) throws java.io.IOException
Processes content from the specified page number using the specified listener. Also allows registration of custom ContentOperators- 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
- Throws:
java.io.IOException
- if operations on the reader fail
-
processContent
public <E extends RenderListener> E processContent(int pageNumber, E renderListener) throws java.io.IOException
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
- Throws:
java.io.IOException
- if operations on the reader fail
-
-