HTML to PDF in CMYK

I'm attempting to convert an HTML or SVG to PDF with the CMYK color space.

                // Code modified for brevity

                HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Blink);
                BlinkConverterSettings settings = new BlinkConverterSettings();
                htmlConverter.ConverterSettings = settings;

                PdfDocument doc = htmlConverter.Convert("sample.html");
                doc.ColorSpace = PdfColorSpace.CMYK;

                doc.Save("output.pdf");


The output seems to always be RGB. Is CMYK not a supported feature?

7 Replies

SL Sowmiya Loganathan Syncfusion Team April 1, 2020 10:40 AM UTC

Hi Joseph,   
  
Thank you for contacting Syncfusion support.    
  
We internally make use of Blink/WebKit rendering engines for converting HTML to PDF. Both rendering engine itself does not have support for converting HTML to PDF with provided color space. The HTML converter will preserve the PDF document based on the input HTML file. If you are facing any issues in color preservation on HTML conversion, please share us the input HTML file, output PDF document and expected output PDF with your exact requirement. So, that it will be helpful for us to analyze and assist you further on this.    
 
Regards, 
Sowmiya Loganathan 



JO Joe April 1, 2020 06:13 PM UTC

Thanks, Sowmiya. I'm not at liberty to share assets in a public forum such as this, but perhaps we can explore offline support.

At a high level, our application needs to produce assets in both a digital format and a print-ready format. We have the digital format in HTML/SVG, but need nearly the same asset as a vector-based, CMYK PDF so it can be sent directly to a printer for production. Our hope is that there is some way to convert the HTML/SVG asset into the print asset that we need. So far, we've only been able to produce an RGB PDF.

We've explored a competitor product whose HTML rendering engine is not nearly as accurate as Blink, and it has issues converting colors, but it is at least in the vector-based, CMYK PDF format that we'll need.

Your suggestions on how to proceed would be greatly appreciated, thanks!


PV Prakash Viswanathan Syncfusion Team April 2, 2020 12:35 PM UTC

Hi Joseph,   
  
Thank you for your update.    
  
As we mentioned earlier, HTML to PDF converter depends on the Blink and WebKit rendering engine. Both rendering engines do not have support for changing the color space of PDF documents when converting HTML to PDF. Both rendering engines will generate a PDF document with an RGB color space. Also, we do not have support for converting the color space of the existing PDF document in our PDF library.    
  
Please let us know if you need any further assistance with this. 

Regards, 
Prakash V 



GK Gowthamraj Kumar Syncfusion Team November 6, 2020 01:42 PM UTC

Hi soroosh, 

Thank you for your update. 

Still, both the rendering engines do not have support for changing the color space of PDF documents when converting HTML to PDF. At present, we do not have support for converting the color space of the existing PDF document in our PDF library. We have logged a feature request for “Add support to changing the color space in an existing PDF document”. We do not have any immediate plans to implement this feature. We will implement this feature in our any of our upcoming releases. 

You can tract the status of this feature request from following feedback link, 

Please let us know if you need any further assistance on this. 

Regards, 
Gowthamraj K 



WC William Chen December 3, 2020 01:23 AM UTC

Hi Gowthamraj,

Hope this finds you well. I am curious if the new “Add support to changing the color space in an existing PDF document” feature has been implemented. As I get Access Denied when trying to access https://www.syncfusion.com/feedback/14101/add-support-to-changing-the-colorspace-in-an-existing-pdf-document .

There is enough traction on our current project  to convert from RGB HTML to CMYK PDF and preserve color per original art assets.

I look forward to hearing back.

Thank You,
Will


GK Gowthamraj Kumar Syncfusion Team December 3, 2020 01:22 PM UTC

Hi William, 
 
No, we do not have support for changing the color space of existing PDF document. Our HTML to PDF converter will generate PDF document only with RGB color space. It will preserve all the object as it is in webpage with RGB color space.  
 
As we said earlier in our updates, we have logged a feature request for “Add support to changing the color space in an existing PDF document”. We do not have any immediate plans to implement this feature. We will implement this feature in our any of our upcoming releases.  
 
We have enabled the access for the below feature request. Now you can tract the status of this feature request from following feedback link,  
 
Regards, 
Gowthamraj K 



WI will November 17, 2022 08:31 AM UTC

Firstly, open the PDF in Acrobat.

Secondly, choose Tools > Print Production > Convert Colours. Select the RGB colour space. ...

Thirdly, click OK and you're done! As you may see, the colours could change slightly or drastically depending on how the artwork was initially set up.


Regards,

Will


Loader.
Up arrow icon