|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.itextpdf.text.pdf.parser.SimpleTextExtractionStrategy
public class SimpleTextExtractionStrategy
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.
Constructor Summary | |
---|---|
SimpleTextExtractionStrategy()
Creates a new text extraction renderer. |
Method Summary | |
---|---|
protected void |
appendTextChunk(CharSequence text)
Used to actually append text to the text results. |
void |
beginTextBlock()
Called when a new text block is beginning (i.e. |
void |
endTextBlock()
Called when a text block has ended (i.e. |
String |
getResultantText()
Returns the result so far. |
void |
renderImage(ImageRenderInfo renderInfo)
no-op method - this renderer isn't interested in image events |
void |
renderText(TextRenderInfo renderInfo)
Captures text using a simplified algorithm for inserting hard returns and spaces |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleTextExtractionStrategy()
Method Detail |
---|
public void beginTextBlock()
RenderListener
beginTextBlock
in interface RenderListener
public void endTextBlock()
RenderListener
endTextBlock
in interface RenderListener
public String getResultantText()
getResultantText
in interface TextExtractionStrategy
protected final void appendTextChunk(CharSequence text)
text
- the text to append to the text results accumulated so farpublic void renderText(TextRenderInfo renderInfo)
renderText
in interface RenderListener
renderInfo
- render infopublic void renderImage(ImageRenderInfo renderInfo)
renderImage
in interface RenderListener
renderInfo
- information specifying what to renderRenderListener.renderImage(com.itextpdf.text.pdf.parser.ImageRenderInfo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |