Class RGBtoCMYKColorMapper

  • All Implemented Interfaces:
    IPdfBoxGraphics2DColorMapper

    public class RGBtoCMYKColorMapper
    extends PdfBoxGraphics2DColorMapper
    Usage:
     PdfBoxGraphics2D pdfBoxGraphics2D = new PdfBoxGraphics2D(this.doc, (int) (width), (int) (height));
     PdfBoxGraphics2DColorMapper colorMapper = new RGBtoCMYKColorMapper(icc_profile);
     pdfBoxGraphics2D.setColorMapper(colorMapper);
     

    Where ICC_Profile is an instance of java.awt.color.ICC_Profile that supports a CMYK colorspace. For testing purposes, we're using ISOcoated_v2_300_bas.icc which ships with PDFBox.

    • Field Detail

      • icc_colorspace

        private final java.awt.color.ICC_ColorSpace icc_colorspace
      • pdProfile

        private final org.apache.pdfbox.pdmodel.graphics.color.PDICCBased pdProfile
    • Constructor Detail

      • RGBtoCMYKColorMapper

        public RGBtoCMYKColorMapper​(java.awt.color.ICC_Profile icc_profile,
                                    org.apache.pdfbox.pdmodel.PDDocument document)
                             throws java.io.IOException
        Throws:
        java.io.IOException