public class PdfTextExtractor extends Object
| Modifier and Type | Field and Description |
|---|---|
private SimpleTextExtractingPdfContentStreamProcessor |
extractionProcessor
The processor that will extract the text.
|
private PdfReader |
reader
The PdfReader that holds the PDF file.
|
| Constructor and Description |
|---|
PdfTextExtractor(PdfReader reader)
Creates a new Text Extractor object.
|
| Modifier and Type | Method and Description |
|---|---|
private byte[] |
getContentBytesForPage(int pageNum)
Gets the content stream of a page.
|
String |
getTextFromPage(int page)
Gets the text from a page.
|
private final PdfReader reader
private final SimpleTextExtractingPdfContentStreamProcessor extractionProcessor
public PdfTextExtractor(PdfReader reader)
reader - the reader with the PDFprivate byte[] getContentBytesForPage(int pageNum)
throws IOException
pageNum - the page number of page you want get the content stream fromIOExceptionpublic String getTextFromPage(int page) throws IOException
page - the page number of the pageIOException