[ 
https://issues.apache.org/jira/browse/PDFBOX-4962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17202585#comment-17202585
 ] 

Tilman Hausherr edited comment on PDFBOX-4962 at 9/27/20, 9:17 AM:
-------------------------------------------------------------------

There are a lot of rendering differences. For example, in the file 
bugzilla886049.pdf (see PDFBOX-1935) the trees are to be dark green. With your 
change they are neon green.

Then I tried using the CMYK profile like this
{code}
ICC_ColorSpace CMYKColorSpace = null;

(...)

String name = "/org/apache/pdfbox/resources/icc/ISOcoated_v2_300_bas.icc";

try (InputStream is = PDDeviceCMYK.class.getResourceAsStream(name))
{
    ICC_Profile iccProfile = ICC_Profile.getInstance(is);
    CMYKColorSpace = new ICC_ColorSpace(iccProfile);
}

(...)

if (colorSpace instanceof PDDeviceCMYK)
{
    return new Color(CMYKColorSpace, color.getComponents(), 1);
}
{code}
The differences were invisible, except for one rendering of the Ghent test 
files which was wrong before and is wrong differently now.

Does the second strategy help with the printing / PS issues mentioned?


was (Author: tilman):
There are a lot of rendering differences. For example, in the file 
bugzilla886049.pdf (see PDFBOX-1935) the trees are to be dark green. With your 
change they are neon green.

Then I tried using the CMYK profile like this
{code}
ICC_ColorSpace CMYKColorSpace = null;

(...)

String name = "/org/apache/pdfbox/resources/icc/ISOcoated_v2_300_bas.icc";

try (InputStream is = PDDeviceCMYK.class.getResourceAsStream(name))
{
    ICC_Profile iccProfile = ICC_Profile.getInstance(is);
    CMYKColorSpace = new ICC_ColorSpace(iccProfile);
}

(...)

if (colorSpace instanceof PDDeviceCMYK)
{
    return new Color(CMYKColorSpace, color.getComponents(), 1);
}
{code}
The differences were invisible, except for one rendering of the Ghent test 
files which was wrong before and is wrong differently now.

Does this strategy help with the printing / PS issues mentioned?

> CMYK support
> ------------
>
>                 Key: PDFBOX-4962
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4962
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Simon Steiner
>            Priority: Major
>         Attachments: pdfbox2cmyk.patch
>
>
> If the content stream has a cmyk color:
> 0 0 0 1 k
> pdfbox will convert this to rgb causing loss of fidelity
> is it possible to pass the cmyk color when you call graphics2d eg:
> {color:#660e7a}graphics{color}.setPaint(cmyk value)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to