Class CustomPageDrawer.MyPageDrawer

Enclosing class:
CustomPageDrawer

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

  • Method Details

    • getPaint

      protected Paint getPaint(PDColor color) throws 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:
      IOException - if the AWT paint could not be created
    • showGlyph

      protected void showGlyph(Matrix textRenderingMatrix, PDFont font, int code, Vector displacement) throws 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:
      IOException - if the glyph cannot be processed
    • fillPath

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

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