Class ExampleColorHandler

java.lang.Object
org.jpedal.examples.handlers.ExampleColorHandler
All Implemented Interfaces:
org.jpedal.external.ColorHandler

public class ExampleColorHandler extends Object implements org.jpedal.external.ColorHandler
  • Constructor Details

    • ExampleColorHandler

      public ExampleColorHandler()
  • Method Details

    • setPaint

      public void setPaint(Graphics2D g2, org.jpedal.color.PdfPaint col, int pageNumber, boolean isPrinting)
      allow user to alter colour (ie to convert to bw)
      Specified by:
      setPaint in interface org.jpedal.external.ColorHandler
      Parameters:
      g2 - The graphics object the paint is being applied to
      col - The paint being applied to the graphics object
      pageNumber - The page that is currently being drawn
      isPrinting - Whether the PDF is being used for printing
    • processImage

      public BufferedImage processImage(BufferedImage image, int pageNumber, boolean isPrinting)
      allow user to alter colour (ie to convert to bw)
      Specified by:
      processImage in interface org.jpedal.external.ColorHandler
      Parameters:
      image - The image to process
      pageNumber - The page the image is from
      isPrinting - Whether the PDF is being used for printing
      Returns:
      A new modified image, or null to not override