public class LocationTextExtractionStrategy extends Object implements ITextExtractionStrategy
| Modifier and Type | Class and Description |
|---|---|
static interface |
LocationTextExtractionStrategy.ITextChunkLocation |
static interface |
LocationTextExtractionStrategy.ITextChunkLocationStrategy |
static class |
LocationTextExtractionStrategy.TextChunk
Represents a chunk of text, it's orientation, and location relative to the orientation vector
|
| Constructor and Description |
|---|
LocationTextExtractionStrategy()
Creates a new text extraction renderer.
|
LocationTextExtractionStrategy(LocationTextExtractionStrategy.ITextChunkLocationStrategy strat)
Creates a new text extraction renderer, with a custom strategy for
creating new TextChunkLocation objects based on the input of the
TextRenderInfo.
|
| Modifier and Type | Method and Description |
|---|---|
void |
eventOccurred(IEventData data,
EventType type)
Called when some event occurs during parsing a content stream.
|
String |
getResultantText()
Returns the text that has been processed so far.
|
Set<EventType> |
getSupportedEvents()
Provides the set of event types this listener supports.
|
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.
|
boolean |
isUseActualText()
Gets the value of the property which determines if /ActualText will be used when extracting
the text
|
LocationTextExtractionStrategy |
setUseActualText(boolean useActualText)
Changes the behavior of text extraction so that if the parameter is set to
true,
/ActualText marked content property will be used instead of raw decoded bytes. |
public LocationTextExtractionStrategy()
public LocationTextExtractionStrategy(LocationTextExtractionStrategy.ITextChunkLocationStrategy strat)
strat - the custom strategypublic LocationTextExtractionStrategy setUseActualText(boolean useActualText)
true,
/ActualText marked content property will be used instead of raw decoded bytes.
Beware: the logic is not stable yet.useActualText - true to use /ActualText, false otherwisepublic boolean isUseActualText()
public void eventOccurred(IEventData data, EventType type)
IEventListenereventOccurred in interface IEventListenerdata - Combines the data required for processing corresponding event type.type - Event type.public Set<EventType> getSupportedEvents()
IEventListenergetSupportedEvents in interface IEventListenerpublic String getResultantText()
ITextExtractionStrategygetResultantText in interface ITextExtractionStrategyString instance with the current resultant textprotected boolean isChunkAtWordBoundary(LocationTextExtractionStrategy.TextChunk chunk, LocationTextExtractionStrategy.TextChunk previousChunk)
chunk - the new chunk being evaluatedpreviousChunk - the chunk that appeared immediately before the current chunkCopyright © 1998–2016 iText Group NV. All rights reserved.