Class PdfContentTextLocator
java.lang.Object
org.openpdf.text.pdf.parser.PdfContentStreamHandler
org.openpdf.text.pdf.parser.PdfContentTextLocator
- Author:
- dgd
-
Nested Class Summary
Nested classes/interfaces inherited from class PdfContentStreamHandler
PdfContentStreamHandler.Do -
Field Summary
Fields inherited from class PdfContentStreamHandler
contextNames, gsStack, operators, renderListener, textFragments, textFragmentStreams, textLineMatrix, textMatrix -
Constructor Summary
ConstructorsConstructorDescriptionPdfContentTextLocator(TextAssembler renderListener, float[] coordinates, int page) Construct a content PdfContetStreamHandler for coordinates-based text extraction patternPdfContentTextLocator(TextAssembler renderListener, String pattern, int page) Construct a content PdfContetStreamHandler for regex-based text extraction pattern -
Method Summary
Modifier and TypeMethodDescriptionprotected voidLoads all the supported graphics and text state operators in a map.voidreset()Methods inherited from class PdfContentStreamHandler
getContentBytesFromPdfObject, getCurrentFont, getCurrentTextLineMatrix, getCurrentTextMatrix, invokeOperator, lookupOperator, processContent, registerContentOperator
-
Constructor Details
-
PdfContentTextLocator
Construct a content PdfContetStreamHandler for regex-based text extraction pattern- Parameters:
renderListener- the text assemblerpattern- the pattern to match text againstpage- PdfPage to inspect
-
PdfContentTextLocator
Construct a content PdfContetStreamHandler for coordinates-based text extraction pattern- Parameters:
renderListener- the text assemblercoordinates- the bounding box to search text withinpage- PdfPage to inspect
-
-
Method Details
-
installDefaultOperators
protected void installDefaultOperators()Loads all the supported graphics and text state operators in a map.- Overrides:
installDefaultOperatorsin classPdfContentStreamHandler
-
reset
public void reset()- Specified by:
resetin classPdfContentStreamHandler
-
getResultantText
- Specified by:
getResultantTextin classPdfContentStreamHandler- Returns:
- result text
-
getMatchedPatterns
- Returns:
- list of text strips that matches
-