How I can use pantone code when create an datamatrix?

141 Views Asked by At

I am creating a new PDF with pdfBox 2.0. In some section I uses a zxing libraries to create a data matrix 2D barcode (similar to QR Code) it generates correctly an image, but my problem comes on the color. I need to print this PDF and the color chosed by company is Pantone 287. Some other similar colors in RGB, CMYK the pressman tell that is not correct. Exists some java library that can use pantone colours??

I've tried to create Matrix directly with correct color pantone 287 but with Zxing libary is imposible. I've tried to change similar/wrong color from image to pantone 287 pixel by pixel in the image, but don't find how to reprint with pantone color.

Color myPantone287 = new Color(0, 82, 156); // Similar Color pantone 287
int colorRgb = myPantone287.getRGB();
MatrixToImageConfig conf = new MatrixToImageConfig(colorRgb , MatrixToImageConfig.WHITE);
BitMatrix byteMatrix = writer.encode(content, BarcodeFormat.DATA_MATRIX, width, width, hints);
MatrixToImageWriter.toBufferedImage(byteMatrix, conf);

Nowadays I print the dataMatrix with RGB(4,84,146) color similar than pantone 287 but not equal. Pantone color is RGB(0,82,156) but when get the int of color to print dataMatrix (required by zxwing library) it changes and it's impossible to has the same color.

Any ideas ??

Thanks in advance.

0

There are 0 best solutions below