public class LocationTextExtractionStrategy extends Object implements ITextExtractionStrategy
| Modifier and Type | Class and Description |
|---|---|
static interface |
LocationTextExtractionStrategy.ITextChunkLocationStrategy |
| 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(TextChunk chunk,
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 |
setRightToLeftRunDirection(boolean rightToLeftRunDirection)
Sets if text flows from left to right or from right to left.
|
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 LocationTextExtractionStrategy setRightToLeftRunDirection(boolean rightToLeftRunDirection)
true argument for extracting Arabic, Hebrew or other
text with right-to-left writing direction.rightToLeftRunDirection - value specifying whether the direction should be right to leftpublic 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(TextChunk chunk, TextChunk previousChunk)
chunk - the new chunk being evaluatedpreviousChunk - the chunk that appeared immediately before the current chunkCopyright © 1998–2025 Apryse Group NV. All rights reserved.