Converting PDF to CMYK with a Custom Color Profile

Hello!
I’m in the process of converting a PDF file that includes both text and images into a CMYK color space. While I’ve successfully converted the text from RGB to CMYK using a specific ICC color profile, I’ve encountered some difficulties with the images. Despite employing the code below to convert the images, I’ve noticed color discrepancies compared to the text:

Document document = new Document("RGB.pdf");
// converting text colors to CMYK
PdfFormatConversionOptions options = new PdfFormatConversionOptions("CMYK-logs.log", PdfFormat.PDF_X_1A);
document.convert(options);
document.save("CMYK.pdf");

Is there any way to convert images using a custom color profile? I’ve attached three PDF files for your reference: the original file, one converted using Adobe, and another showing the results of our efforts using Aspose.
files.zip (1005.6 KB)

Additionally, I’ve observed that post-CMYK conversion, the image filter differs between Adobe and Aspose, with Aspose utilizing ZIP while Adobe employs JPEG. Is there a way to adjust the filter to JPEG for consistency? I’ve attached a comparison photo illustrating the differences between the files generated by Adobe and Aspose.

Environment Details:

  • Aspose.PDF for Java version: 22.2
  • Java version: 17
  • Operating System: Windows

Thank you!

@Ligita
I’ll investigate this issue and write you as soon as possible

@Ligita
I reproduced the issue on latest version
Could you please share code where you successfully converted text from RGB to CMYK so I could attach it to ticket?
Maybe it will be useful for development team in order to anwser your question

@ilya.zhuykov
Certainly. I’ve developed the code based on the document Changing Color Space of a PDF Document. In addition, I’ve integrated a custom ICC profile to improve color accuracy. Here is my code.
convertToCmyk.zip (746 Bytes)

@Ligita
Thank you, I’ll try to contact development team for explanation and write you as soon as possible

@Ligita
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-43818

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.