Forum How do I...?

device-cmyk property does not support by prince xml yet?

Chella
Hi Mike,

I have tried to create an SVG file and CMYK color space by using SVG property of device-cmyk. The output was not as expected. The output shows only the "stroke" value and "fill" value not came out. Can you help me out whether did I do anything wrong on SVG property or prince XML doesn't support device-cmyk property?
Are there any possibilities to achieve this in princeXML?

Source:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 219 183"><defs><style>.cls-1{stroke-miterlimit:10;stroke-width:3px;}</style></defs><title>fig01</title><rect class="cls-1" x="1.5" y="1.5" width="216" height="180" fill="#009fe3 cmyk(1, 0, 0, 0)" stroke="#1d1d1b cmyk(0, 0, 0, 1)"/></svg>
</body>
</html>

Thanks & Regards,
Chella|TNQ Technologies
+91 98 84 504995

  1. BCAB107723-prince.pdf2.2 kB
    output
Chella
I have tried to create a pdf for an SVG file and CMYK color space by using SVG property of device-cmyk.

Thanks & Regards,
Chella|TNQ Technologies
+91 98 84 504995

mikeday
You can use the cmyk() or device-cmyk() function but not specifying an RGB color as well.
Chella
Thank you. It's working !!! :)

Thanks & Regards,
Chella|TNQ Technologies
+91 98 84 504995

marzaq
I have large svg files; That's why I don't want to put its contents on the page; Because it will collapse. I want to include it in the img tag. If I do this it does not give the cmyk colors that I specified in the file.
Could you help me with that please?
Thanks & Regards,
  1. 2.svg4.4 MB
  2. indexwithSVGInIMGtag.htm108.6 kB
nora
You could potentially use CSS to define CMYK color values as custom properties and then convert them using Prince XML's color functions.
marzaq
Thank you for your repone. شكرا جزيلا لتفاعلكم.
I already did that in the svg file "2.svg"
.DarkBrownFill{
color: cmyk(29.02%, 81.83%, 86.98%, 26.8%);
fill: cmyk(29.02%, 81.83%, 86.98%, 26.8%)
}

but when i use : <img src="2.svg" /> the colors changing to RGB. while if i put ths svg contents "xml" in the work page it's working fine. but i can't put all svg files contents the page will collapse.
thank you
wangp
The 2.svg file only uses RGB colors, e.g.
    <path
       d="M 6.727,6.926 H 217.206 V 333.21 H 6.727 Z"
       style="fill:#8c3228;fill-opacity:1;fill-rule:nonzero;stroke:none"
       id="path45139" />

There are no references to the DarkBrownFill and other classes.
marzaq
Thank You very much. nora & wangp
It was my bad, i used worng file. CMYK working for me now.
I am trying to use Pantone Colors:
pantone 7600 c 100% = cmyk(29.02%, 81.83%, 86.98%, 26.8%) According to adobe illustrator
pantone 7600 c 30% = cmyk(8.76%, 24.71%, 26.26%, 8.09%) According to adobe illustrator
pantone 3288 c 100% = cmyk(100%, 23.37%, 72.72%, 9.4%) According to adobe illustrator
pantone 3288 c 30% = cmyk(30.2%, 7.06%, 21.96%, 2.84%) According to adobe illustrator
black
I need pdf to be in this colors, what can I do please?
  1. 1.svg4.4 MB
  2. ‏‏index2.html11.9 kB

Edited by marzaq

wangp
In the style rules of the main document (which can be an external style sheet file), define the spot colors you want to use, e.g.
@prince-color "Pantone 7600 C" {
    alternate-color: cmyk(29.02%, 81.83%, 86.98%, 26.8%);
}
@prince-color "Pantone 3288 C" {
    alternate-color: cmyk(100%, 23.37%, 72.72%, 9.4%);
}

Then in the image you can refer to those spot colors, e.g.
fill: prince-color("Pantone 7600 C");
...
fill: prince-color("Pantone 3288 C", 30%);

Note that it will not work to define the spot colors in the style sheet of the image file itself.
marzaq
Thank you very much wangp
IT'S WORKING FINE.