Rank: Newbie Groups: Member
Joined: 9/4/2012 Posts: 2
|
How do i create a PDF with CMYK colors using HtmlToPdf?
I can see it is possible to define af PdfColor as CMYK from your documentation, but I don't know how to get the color's in that colorspace. I worked with a couple of solutions: 1. I tried defining the colors as 'device-cmyk(0,0,0,1)' but it was ignored. 2. Another attempt was changing the colors after converting them to HTML, but i can't seem to find where the colors are defined in PdfContent. 3. Another solution i could imagine is hooking into the HtmlToPdf converter and change the color before its printed, but I don't think thats possible right away?
I'm working with html containing text, tables, borders, images and SVG's.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
You can not use CMYK color. The core web engine of the HTML to PDF converter uses RGB color model internally. So even if you could use CMYK, it will still be converted to RGB for internal processing, which would lose all advantage of CMYK color model. Sorry about that!
|
Rank: Newbie Groups: Member
Joined: 9/4/2012 Posts: 2
|
It's kind of a must that the PDF is in CMYK color, since its for printing. Could it be done by extending HtmlToPdf with a color converter or similar? If the library can't do it right know, would it be possible to get you to implement a way so it will be possible?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
No. We do not see any possibility to support that in the near future. The root of the problem is the Web engine uses RGB internal ---- changing that is no small task at all. The best you can do is to back convert CMYK color to their equivalent RGB color and then use RGB color instead. There is no easy way for you to modify a PDF file to update its color model either.
Thanks!
|