|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.parser.SimpleTextExtractingPdfContentRenderListener
public class SimpleTextExtractingPdfContentRenderListener
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.
Field Summary | |
---|---|
private Vector |
lastEnd
|
private float |
lastEndingXPos
keeps track of the X position of the end of the last rendered text |
private Vector |
lastStart
|
private Matrix |
lastTextLineMatrix
|
private float |
lastYPos
keeps track of the Y position of the last rendered text |
private StringBuffer |
result
used to store the resulting String. |
Constructor Summary | |
---|---|
SimpleTextExtractingPdfContentRenderListener()
Creates a new text extraction renderer. |
Method Summary | |
---|---|
String |
getResultantText()
Returns the result so far. |
void |
renderText(TextRenderInfo renderInfo)
Captures text using a simplified algorithm for inserting hard returns and spaces |
void |
reset()
Resets the internal state of the RenderListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private float lastYPos
private float lastEndingXPos
private Matrix lastTextLineMatrix
private Vector lastStart
private Vector lastEnd
private StringBuffer result
Constructor Detail |
---|
public SimpleTextExtractingPdfContentRenderListener()
Method Detail |
---|
public void reset()
RenderListener
reset
in interface RenderListener
public String getResultantText()
getResultantText
in interface TextProvidingRenderListener
public void renderText(TextRenderInfo renderInfo)
renderText
in interface RenderListener
renderInfo
- information specifying what to rendercom.lowagie.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)
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |