Export PDF in CMYK Color format using Aspose.PDF for Java

@wvlabelmaker

Please check attached PDF where SVG was inserted directly without being converted into PNG and share your feedback with us about its colorspace:

CMYK_SVG_20_6__cmyk.pdf (499.9 KB)

Hi @asad.ali, please see the screenshot(CMYK_screenshot_3.png (91.8 KB)
), It is coming as a different CMYK value, we require it to have 0,0,0,100 as CMYK value.

@wvlabelmaker

We have logged an issue as PDFJAVA-39618 in our issue tracking system for further investigation against your case. Please note that we used Aspose.PDF for Java 20.7 in order to test the scenario using following code snippet and attached SVG:

SvgLoadOptions svgload = new SvgLoadOptions();
Document doc = new Document(dataDir + "CMYK_SVG.svg", svgload);
doc.save(dataDir + "output.pdf");
doc = new Document(dataDir + "output.pdf");
doc.convert(dataDir+"CMYK_SVG.log", PdfFormat.PDF_X_1A, ConvertErrorAction.Delete);
doc.save(dataDir + "CMYK_SVG_20_6__cmyk.pdf");

CMYK_SVG.zip (6.2 KB)

We will let you know as soon as the ticket is resolved. Please spare us some time.

We are sorry for the inconvenience.

Hi @asad.ali, thanks for your input. I will wait for your reply.

Hi @asad.ali, just wanted to know if any progress is made on this ticket?

@wvlabelmaker

Regretfully, the ticket is not yet resolved. As soon as we complete investigation against it, we will inform you within this forum thread. Please give us some time.

Hi @asad.ali, can you share an ETA on this ticket?

@wvlabelmaker

Sadly, the investigation against the ticket is not yet completed and we will be in a position to share the ETA once analysis against the ticket is done. We have recorded your concerns and will surley inform you as soon as the ticket is analyzed and we have some information about the ETA. Please give us some time.

We apologize for your inconvenience.

@wvlabelmaker

We have further investigated the earlier logged ticket and found that there is no mathematical/logical way to convert from RGB to CMYK. There is no such thing as ordinary/standard/generic/straight CMYK. A CMYK image is just a collection of raster percentages. Instructions for the printing device - not objective colors. It will look differently depending on which exact inks the printer uses, which paper you print on, the device itself, how it is calibrated, etc.

This is why color profiles were invented. They are made by agreeing on a set of standard settings for a given device and then printing physical swatches which are measured to create conversion tables.

In the current document color can’t be 0,0,0,100 as CMYK value because source rgb value is not black (0,0,0) but gray rgb(35, 31, 32).

In Aspose.PDF, we convert RGB->CMYK colors using the SWOP2006_Coated3v2 profile, and the conversion is compatible with this standard.

For example this profile converts RGB 0,0,0,-> CMYK 71% 65% 64% 99% and this is correct value.

At the same time we can find for testing some online converter (for example this: Free Color Converter - RGB, CMYK, LAB, XYZ, HEX and more! ) and get RGB 0,0,0,-> CMYK 75% 68% 67% 90% and this is also correct, but they are using another profile.