Package de.rototor.pdfbox.graphics2d
Class RGBtoCMYKColorMapper
- java.lang.Object
-
- de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DColorMapper
-
- de.rototor.pdfbox.graphics2d.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.rototor.pdfbox.graphics2d.IPdfBoxGraphics2DColorMapper
IPdfBoxGraphics2DColorMapper.IColorMapperEnv
-
-
Constructor Summary
Constructors Constructor Description RGBtoCMYKColorMapper(ICC_Profile icc_profile, org.apache.pdfbox.pdmodel.PDDocument document)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.pdfbox.pdmodel.graphics.color.PDColor
mapColor(Color rgbColor, IPdfBoxGraphics2DColorMapper.IColorMapperEnv env)
Map the given Color to a PDColor
-
-
-
Constructor Detail
-
RGBtoCMYKColorMapper
public RGBtoCMYKColorMapper(ICC_Profile icc_profile, org.apache.pdfbox.pdmodel.PDDocument document) throws IOException
- Throws:
IOException
-
-
Method Detail
-
mapColor
public org.apache.pdfbox.pdmodel.graphics.color.PDColor mapColor(Color rgbColor, IPdfBoxGraphics2DColorMapper.IColorMapperEnv env)
Description copied from interface:IPdfBoxGraphics2DColorMapper
Map the given Color to a PDColor- Specified by:
mapColor
in interfaceIPdfBoxGraphics2DColorMapper
- Overrides:
mapColor
in classPdfBoxGraphics2DColorMapper
- Parameters:
rgbColor
- the color to mapenv
- the environment which allow getting the content stream, resources etc.- Returns:
- the mapped color
-
-