Class CustomPageDrawer.MyPageDrawer

  • Enclosing class:
    CustomPageDrawer

    private static class CustomPageDrawer.MyPageDrawer
    extends PageDrawer
    Example PageDrawer subclass with custom rendering.
    • Constructor Detail

      • MyPageDrawer

        MyPageDrawer​(PageDrawerParameters parameters)
              throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getPaint

        protected java.awt.Paint getPaint​(PDColor color)
                                   throws java.io.IOException
        Color replacement.
        Overrides:
        getPaint in class PageDrawer
        Parameters:
        color - The color to get a paint for. This can be an actual color or a pattern.
        Returns:
        an AWT paint for the given PDColor
        Throws:
        java.io.IOException - if the AWT paint could not be created
      • showGlyph

        protected void showGlyph​(Matrix textRenderingMatrix,
                                 PDFont font,
                                 int code,
                                 Vector displacement)
                          throws java.io.IOException
        Glyph bounding boxes.
        Overrides:
        showGlyph in class PDFStreamEngine
        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
      • fillPath

        public void fillPath​(int windingRule)
                      throws java.io.IOException
        Filled path bounding boxes.
        Overrides:
        fillPath in class PageDrawer
        Parameters:
        windingRule - The winding rule this path will use.
        Throws:
        java.io.IOException - if the path could not be filled
      • showAnnotation

        public void showAnnotation​(PDAnnotation annotation)
                            throws java.io.IOException
        Custom annotation rendering.
        Overrides:
        showAnnotation in class PageDrawer
        Parameters:
        annotation - An annotation on the current page.
        Throws:
        java.io.IOException - If an error occurred reading the annotation