You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2020/09/26 11:32:00 UTC

[jira] [Comment Edited] (PDFBOX-4962) CMYK support

    [ 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/26/20, 11:31 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.


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.

> 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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org