Class SimpleTextExtractionStrategy
- java.lang.Object
-
- com.itextpdf.kernel.pdf.canvas.parser.listener.SimpleTextExtractionStrategy
-
- All Implemented Interfaces:
IEventListener,ITextExtractionStrategy
public class SimpleTextExtractionStrategy extends java.lang.Object implements ITextExtractionStrategy
-
-
Constructor Summary
Constructors Constructor Description SimpleTextExtractionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendTextChunk(java.lang.CharSequence text)Used to actually append text to the text results.voideventOccurred(IEventData data, EventType type)Called when some event occurs during parsing a content stream.java.lang.StringgetResultantText()Returns the result so far.java.util.Set<EventType>getSupportedEvents()Provides the set of event types this listener supports.
-
-
-
Method Detail
-
eventOccurred
public void eventOccurred(IEventData data, EventType type)
Description copied from interface:IEventListenerCalled when some event occurs during parsing a content stream.- Specified by:
eventOccurredin interfaceIEventListener- Parameters:
data- Combines the data required for processing corresponding event type.type- Event type.
-
getSupportedEvents
public java.util.Set<EventType> getSupportedEvents()
Description copied from interface:IEventListenerProvides the set of event types this listener supports. Returns null if all possible event types are supported.- Specified by:
getSupportedEventsin interfaceIEventListener- Returns:
- Set of event types supported by this listener or null if all possible event types are supported.
-
getResultantText
public java.lang.String getResultantText()
Returns the result so far.- Specified by:
getResultantTextin interfaceITextExtractionStrategy- Returns:
- a String with the resulting text.
-
appendTextChunk
protected final void appendTextChunk(java.lang.CharSequence text)
Used to actually append text to the text results. Subclasses can use this to insert text that wouldn't normally be included in text parsing (e.g. result of OCR performed against image content)- Parameters:
text- the text to append to the text results accumulated so far
-
-