|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.parser.PdfTextExtractor
public class PdfTextExtractor
Extracts text from a PDF file.
Field Summary | |
---|---|
private PdfReader |
reader
The PdfReader that holds the PDF file. |
private TextProvidingRenderListener |
renderListener
The TextProvidingRenderListener that will receive render notifications and provide resultant text |
Constructor Summary | |
---|---|
PdfTextExtractor(PdfReader reader)
Creates a new Text Extractor object, using a SimpleTextExtractingPdfContentRenderListener as the render listener |
|
PdfTextExtractor(PdfReader reader,
TextProvidingRenderListener renderListener)
Creates a new Text Extractor object. |
Method Summary | |
---|---|
private byte[] |
getContentBytesForPage(int pageNum)
Gets the content bytes of a page. |
private byte[] |
getContentBytesFromContentObject(PdfObject contentObject)
Gets the content bytes from a content object, which may be a reference a stream or an array. |
String |
getTextFromPage(int page)
Gets the text from a page. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final PdfReader reader
private final TextProvidingRenderListener renderListener
TextProvidingRenderListener
that will receive render notifications and provide resultant text
Constructor Detail |
---|
public PdfTextExtractor(PdfReader reader)
SimpleTextExtractingPdfContentRenderListener
as the render listener
reader
- the reader with the PDFpublic PdfTextExtractor(PdfReader reader, TextProvidingRenderListener renderListener)
reader
- the reader with the PDFrenderListener
- the render listener that will be used to analyze renderText operations and provide resultant textMethod Detail |
---|
private byte[] getContentBytesForPage(int pageNum) throws IOException
pageNum
- the page number of page you want get the content stream from
IOException
private byte[] getContentBytesFromContentObject(PdfObject contentObject) throws IOException
contentObject
- the object to read bytes from
IOException
public String getTextFromPage(int page) throws IOException
page
- the page number of the page
IOException
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |