Class DebugTextOverlay.DebugTextStripper

    • Field Detail

      • graphics

        private final java.awt.Graphics2D graphics
      • flipAT

        private java.awt.geom.AffineTransform flipAT
      • transAT

        private java.awt.geom.AffineTransform transAT
    • Constructor Detail

      • DebugTextStripper

        DebugTextStripper​(java.awt.Graphics2D graphics)
    • 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.IOException
        Description copied from class: PDFTextStripper
        Write a Java string to the output stream. The default implementation will ignore the textPositions and just calls PDFTextStripper.writeString(String).
        Overrides:
        writeString in class PDFTextStripper
        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: LegacyPDFStreamEngine
        Called when a glyph is to be processed. The heuristic calculations here were originally written by Ben Litchfield for PDFStreamEngine.
        Overrides:
        showGlyph in class LegacyPDFStreamEngine
        Parameters:
        textRenderingMatrix - the current text rendering matrix, Trm
        font - the current font
        code - internal PDF character code for the glyph
        displacement - the displacement (i.e. advance) of the glyph in text space
        Throws:
        java.io.IOException - if the glyph cannot be processed
      • calculateGlyphBounds

        private java.awt.Shape calculateGlyphBounds​(java.awt.geom.AffineTransform at,
                                                    PDFont font,
                                                    int code,
                                                    Vector displacement)
                                             throws java.io.IOException
        Throws:
        java.io.IOException