Class PdfTextExtractor
java.lang.Object
com.lowagie.text.pdf.parser.PdfTextExtractor
Deprecated.
Extracts text from a PDF file.
- Since:
- 2.1.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PdfReaderDeprecated.The PdfReader that holds the PDF file.private final TextAssemblerDeprecated.TheTextAssemblerthat will receive render notifications and provide resultant text -
Constructor Summary
ConstructorsConstructorDescriptionPdfTextExtractor(PdfReader reader) Deprecated.Creates a new Text Extractor object, using aTextAssembleras the render listenerPdfTextExtractor(PdfReader reader, boolean usePdfMarkupElements) Deprecated.Creates a new Text Extractor object, using aTextAssembleras the render listenerPdfTextExtractor(PdfReader reader, TextAssembler renderListener) Deprecated.Creates a new Text Extractor object. -
Method Summary
Modifier and TypeMethodDescriptionprivate byte[]getContentBytesForPage(int pageNum) Deprecated.Gets the content bytes of a page.private byte[]getContentBytesFromContentObject(PdfObject contentObject) Deprecated.Gets the content bytes from a content object, which may be a reference a stream or an array.getTextFromPage(int page) Deprecated.Gets the text from a page.getTextFromPage(int page, boolean useContainerMarkup) Deprecated.get the text from the pagevoidprocessContent(byte[] contentBytes, PdfDictionary resources, PdfContentStreamHandler handler) Deprecated.Processes PDF syntax
-
Field Details
-
reader
-
renderListener
Deprecated.TheTextAssemblerthat will receive render notifications and provide resultant text
-
-
Constructor Details
-
PdfTextExtractor
Deprecated.Creates a new Text Extractor object, using aTextAssembleras the render listener- Parameters:
reader- the reader with the PDF
-
PdfTextExtractor
Deprecated.Creates a new Text Extractor object, using aTextAssembleras the render listener- Parameters:
reader- the reader with the PDFusePdfMarkupElements- should we use higher level tags for PDF markup entities?
-
PdfTextExtractor
Deprecated.Creates a new Text Extractor object.- Parameters:
reader- the reader with the PDFrenderListener- the render listener that will be used to analyze renderText operations and provide resultant text
-
-
Method Details
-
getContentBytesForPage
Deprecated.Gets the content bytes of a page.- Parameters:
pageNum- the 1-based page number of page you want get the content stream from- Returns:
- a byte array with the effective content stream of a page
- Throws:
IOException
-
getContentBytesFromContentObject
Deprecated.Gets the content bytes from a content object, which may be a reference a stream or an array.- Parameters:
contentObject- the object to read bytes from- Returns:
- the content bytes
- Throws:
IOException
-
getTextFromPage
Deprecated.Gets the text from a page.- Parameters:
page- the 1-based page number of page- Returns:
- a String with the content as plain text (without PDF syntax)
- Throws:
IOException- on error
-
getTextFromPage
Deprecated.get the text from the page- Parameters:
page- page number we are interested inuseContainerMarkup- should we put tags in for PDf markup container elements (not really HTML at the moment).- Returns:
- result of extracting the text, with tags as requested.
- Throws:
IOException- on error
-
processContent
public void processContent(byte[] contentBytes, PdfDictionary resources, PdfContentStreamHandler handler) Deprecated.Processes PDF syntax- Parameters:
contentBytes- the bytes of a content streamresources- the resources that come with the content streamhandler- interprets events caused by recognition of operations in a content stream.
-