public class LocationTextExtractionStrategy extends java.lang.Object implements TextExtractionStrategy
Modifier and Type | Class and Description |
---|---|
static class |
LocationTextExtractionStrategy.TextChunk
Represents a chunk of text, it's orientation, and location relative to the orientation vector
|
static interface |
LocationTextExtractionStrategy.TextChunkFilter
Specifies a filter for filtering
LocationTextExtractionStrategy.TextChunk objects during text extraction |
Constructor and Description |
---|
LocationTextExtractionStrategy()
Creates a new text extraction renderer.
|
Modifier and Type | Method and Description |
---|---|
void |
beginTextBlock()
Called when a new text block is beginning (i.e.
|
void |
endTextBlock()
Called when a text block has ended (i.e.
|
java.lang.String |
getResultantText()
Returns the result so far.
|
java.lang.String |
getResultantText(LocationTextExtractionStrategy.TextChunkFilter chunkFilter)
Gets text that meets the specified filter
If multiple text extractions will be performed for the same page (i.e.
|
protected boolean |
isChunkAtWordBoundary(LocationTextExtractionStrategy.TextChunk chunk,
LocationTextExtractionStrategy.TextChunk previousChunk)
Determines if a space character should be inserted between a previous chunk and the current chunk.
|
void |
renderImage(ImageRenderInfo renderInfo)
no-op method - this renderer isn't interested in image events
|
void |
renderText(TextRenderInfo renderInfo)
Called when text should be rendered
|
public LocationTextExtractionStrategy()
public void beginTextBlock()
RenderListener
beginTextBlock
in interface RenderListener
RenderListener.beginTextBlock()
public void endTextBlock()
RenderListener
endTextBlock
in interface RenderListener
RenderListener.endTextBlock()
protected boolean isChunkAtWordBoundary(LocationTextExtractionStrategy.TextChunk chunk, LocationTextExtractionStrategy.TextChunk previousChunk)
chunk
- the new chunk being evaluatedpreviousChunk
- the chunk that appeared immediately before the current chunkpublic java.lang.String getResultantText(LocationTextExtractionStrategy.TextChunkFilter chunkFilter)
FilteredRenderListener
- but not nearly as powerful
because most of the RenderInfo state is not captured in LocationTextExtractionStrategy.TextChunk
chunkFilter
- the filter to to applypublic java.lang.String getResultantText()
getResultantText
in interface TextExtractionStrategy
public void renderText(TextRenderInfo renderInfo)
RenderListener
renderText
in interface RenderListener
renderInfo
- information specifying what to renderRenderListener.renderText(com.itextpdf.text.pdf.parser.TextRenderInfo)
public void renderImage(ImageRenderInfo renderInfo)
renderImage
in interface RenderListener
renderInfo
- information specifying what to renderRenderListener.renderImage(com.itextpdf.text.pdf.parser.ImageRenderInfo)
Copyright © 2013. All Rights Reserved.