0

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.

Spulit
  • 1
  • 2
  • According to https://www.pantone.com/color-finder/287-C that is (0 48 135) and not (0 82 156). – Tilman Hausherr May 15 '19 at 10:10
  • It might also be needed to use an output intent with the sRGB ICC file, see the CreatePDFA.java example in the source code download. – Tilman Hausherr May 15 '19 at 10:17
  • Thanks Tilman, for yours comments, it's really strange because I found a function in java that can tell me the colors used on a pdf template. And the color that I must to use is Pantone 287. I Search on pantone.com to find this color without C but don't appears... It's strange. On the other hand I will to try to write the datamatrix with pdfBox library, because it can write in this color obtained on the pdf template. – Spulit May 21 '19 at 08:55

0 Answers0