Class DebugTextOverlay.DebugTextStripper
- java.lang.Object
-
- org.apache.pdfbox.contentstream.PDFStreamEngine
-
- org.apache.pdfbox.text.LegacyPDFStreamEngine
-
- org.apache.pdfbox.text.PDFTextStripper
-
- org.apache.pdfbox.debugger.pagepane.DebugTextOverlay.DebugTextStripper
-
- Enclosing class:
- DebugTextOverlay
private class DebugTextOverlay.DebugTextStripper extends PDFTextStripper
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.geom.AffineTransformflipATprivate java.awt.Graphics2Dgraphicsprivate java.awt.geom.AffineTransformtransAT-
Fields inherited from class org.apache.pdfbox.text.PDFTextStripper
charactersByArticle, document, LINE_SEPARATOR, output
-
-
Constructor Summary
Constructors Constructor Description DebugTextStripper(java.awt.Graphics2D graphics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.awt.ShapecalculateGlyphBounds(java.awt.geom.AffineTransform at, PDFont font, int code, Vector displacement)protected voidshowGlyph(Matrix textRenderingMatrix, PDFont font, int code, Vector displacement)Called when a glyph is to be processed.voidstripPage(PDDocument document, PDPage page, int pageIndex, float scale)private voidtransform(java.awt.Graphics2D graphics, PDPage page, float scale)protected voidwriteString(java.lang.String string, java.util.List<TextPosition> textPositions)Write a Java string to the output stream.-
Methods inherited from class org.apache.pdfbox.text.PDFTextStripper
beginMarkedContentSequence, endArticle, endDocument, endMarkedContentSequence, endPage, getAddMoreFormatting, getArticleEnd, getArticleStart, getAverageCharTolerance, getCharactersByArticle, getCurrentPageNo, getDropThreshold, getEndBookmark, getEndPage, getIgnoreContentStreamSpaceGlyphs, getIndentThreshold, getLineSeparator, getListItemPatterns, getOutput, getPageEnd, getPageStart, getParagraphEnd, getParagraphStart, getSeparateByBeads, getSortByPosition, getSpacingTolerance, getStartBookmark, getStartPage, getSuppressDuplicateOverlappingText, getText, getWordSeparator, matchPattern, processPage, processPages, processTextPosition, setAddMoreFormatting, setArticleEnd, setArticleStart, setAverageCharTolerance, setDropThreshold, setEndBookmark, setEndPage, setIgnoreContentStreamSpaceGlyphs, setIndentThreshold, setLineSeparator, setListItemPatterns, setPageEnd, setPageStart, setParagraphEnd, setParagraphStart, setShouldSeparateByBeads, setSortByPosition, setSpacingTolerance, setStartBookmark, setStartPage, setSuppressDuplicateOverlappingText, setWordSeparator, startArticle, startArticle, startDocument, startPage, writeCharacters, writeLineSeparator, writePage, writePageEnd, writePageStart, writeParagraphEnd, writeParagraphSeparator, writeParagraphStart, writeString, writeText, writeWordSeparator
-
Methods inherited from class org.apache.pdfbox.text.LegacyPDFStreamEngine
computeFontHeight
-
Methods inherited from class org.apache.pdfbox.contentstream.PDFStreamEngine
addOperator, applyTextAdjustment, beginText, decreaseLevel, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getLevel, getResources, getTextLineMatrix, getTextMatrix, increaseLevel, isShouldProcessColorOperators, markedContentPoint, operatorException, processAnnotation, processChildStream, processOperator, processOperator, processSoftMask, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showForm, showText, showTextString, showTextStrings, showTransparencyGroup, showType3Glyph, transformedPoint, transformWidth, unsupportedOperator
-
-
-
-
Method Detail
-
stripPage
public void stripPage(PDDocument document, PDPage page, int pageIndex, float scale) throws java.io.IOException
- Throws:
java.io.IOException
-
transform
private void transform(java.awt.Graphics2D graphics, PDPage page, float scale)
-
writeString
protected void writeString(java.lang.String string, java.util.List<TextPosition> textPositions) throws java.io.IOExceptionDescription copied from class:PDFTextStripperWrite a Java string to the output stream. The default implementation will ignore thetextPositionsand just callsPDFTextStripper.writeString(String).- Overrides:
writeStringin classPDFTextStripper- Parameters:
string- The text to write to the stream.textPositions- The TextPositions belonging to the text.- Throws:
java.io.IOException- If there is an error when writing the text.
-
showGlyph
protected void showGlyph(Matrix textRenderingMatrix, PDFont font, int code, Vector displacement) throws java.io.IOException
Description copied from class:LegacyPDFStreamEngineCalled when a glyph is to be processed. The heuristic calculations here were originally written by Ben Litchfield for PDFStreamEngine.- Overrides:
showGlyphin classLegacyPDFStreamEngine- Parameters:
textRenderingMatrix- the current text rendering matrix, Trmfont- the current fontcode- internal PDF character code for the glyphdisplacement- the displacement (i.e. advance) of the glyph in text space- Throws:
java.io.IOException- if the glyph cannot be processed
-
-