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.
| Modifier and Type | Field and Description |
|---|---|
| private final ICC_ColorSpace | |
| private final PDICCBased |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public PDColor | mapColor(Color
the color to map rgbColor, IPdfBoxGraphics2DColorMapper.the environment which allow getting the content stream, resources
etc. envOverrides de. Implements de. Map the given Color to a PDColor |
| private static float[] |
| icc_colorspace | back to summary |
|---|---|
| private final ICC_ColorSpace icc_colorspace | |
| pdProfile | back to summary |
|---|---|
| private final PDICCBased pdProfile | |
| RGBtoCMYKColorMapper | back to summary |
|---|---|
| public RGBtoCMYKColorMapper(ICC_Profile icc_profile, PDDocument document) throws IOException | |
| mapColor | back to summary |
|---|---|
| public PDColor mapColor(Color rgbColor, IPdfBoxGraphics2DColorMapper. Overrides de. Implements de. Doc from de. Map the given Color to a PDColor
| |
| rgbIntToFloat | back to summary |
|---|---|
| private static float[] rgbIntToFloat(int[] rgbInts) | |