Module itextpdf
Package com.itextpdf.text.pdf.parser
Class SimpleTextExtractingPdfContentRenderListener
- java.lang.Object
-
- com.itextpdf.text.pdf.parser.SimpleTextExtractingPdfContentRenderListener
-
- All Implemented Interfaces:
RenderListener,TextProvidingRenderListener
public class SimpleTextExtractingPdfContentRenderListener extends java.lang.Object implements TextProvidingRenderListener
A simple text extraction renderer. This renderer keeps track of the current Y position of each string. If it detects that the y position has changed, it inserts a line break into the output. If the PDF renders text in a non-top-to-bottom fashion, this will result in the text not being a true representation of how it appears in the PDF. This renderer also uses a simple strategy based on the font metrics to determine if a blank space should be inserted into the output.- Since:
- 2.1.5
-
-
Constructor Summary
Constructors Constructor Description SimpleTextExtractingPdfContentRenderListener()Creates a new text extraction renderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetResultantText()Returns the result so far.voidrenderText(TextRenderInfo renderInfo)Captures text using a simplified algorithm for inserting hard returns and spacesvoidreset()Resets the internal state of the RenderListener
-
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:RenderListenerResets the internal state of the RenderListener- Specified by:
resetin interfaceRenderListener
-
getResultantText
public java.lang.String getResultantText()
Returns the result so far.- Specified by:
getResultantTextin interfaceTextProvidingRenderListener- Returns:
- a String with the resulting text.
-
renderText
public void renderText(TextRenderInfo renderInfo)
Captures text using a simplified algorithm for inserting hard returns and spaces- Specified by:
renderTextin interfaceRenderListener- Parameters:
renderInfo- information specifying what to render- See Also:
com.itextpdf.text.pdf.parser.AbstractRenderListener#renderText(java.lang.String, com.lowagie.text.pdf.parser.GraphicsState, com.lowagie.text.pdf.parser.Matrix, com.lowagie.text.pdf.parser.Matrix)
-
-