Details

Description

I have a PDF that uses a DeviceN color space, but when using the PDFToImage utility I noticed that some of the text comes out as cyan.

I tracked the issue down to when the scn or SCN operator is used without setting the color space explicitly (ie using the current color space). I have attached a patch which resolves the issue by reinstating the original (DeviceN) color space after using the alternate color space, otherwise the alternate color space (in this case CMYK) was seen as the current color space and the attribute of 1 for the scn operator, which was meant for the DeviceN color space, is used in the CMYK color space resulting in the cyan.

I have also attached an example PDF and the result for the PDFToImage conversion.

@Daniel
I assume that you don't have a sample for a [1,0] DecodeArray, have you? If not I'll set this issue to resolved. I added a TODO comment, so that we will (hopefully) find the relevant part of the source, if we'll get a suitable sample for that case in the future.

Andreas Lehmkühler
added a comment - 14/Oct/11 05:41 @Daniel
I assume that you don't have a sample for a [1,0] DecodeArray, have you? If not I'll set this issue to resolved. I added a TODO comment, so that we will (hopefully) find the relevant part of the source, if we'll get a suitable sample for that case in the future.

Andreas Lehmkühler
added a comment - 12/Oct/11 18:02 I guess I resolved the issue in revision 1182494.
The stencil mask works better than before. Former PDFBox versions always used black as color for the stencil mask and now following the specs the non stroking color will be used
There is one TODO left. The stencil mask creation is based on default values ( [0,1] ) for the DecodeArray. Does anyone have a sample using [1,0] as DecodeArray?

I had hoped this would resolve some test failures I've seen recently, but it didn't resolve all of them.

ARCHIVERGB is showing 2 problems:
1. The stencil mask is missing completely
2. Some of the letters are not being filled. I've seen this in other cases that I have not yet received permission to release ... a group of letters will have only the first filled with the fill color.

Back in August, these items were working better ... so one of us made a mistake somewhere.

Daniel Wilson
added a comment - 11/Oct/11 14:08 I had hoped this would resolve some test failures I've seen recently, but it didn't resolve all of them.
ARCHIVERGB is showing 2 problems:
1. The stencil mask is missing completely
2. Some of the letters are not being filled. I've seen this in other cases that I have not yet received permission to release ... a group of letters will have only the first filled with the fill color.
Back in August, these items were working better ... so one of us made a mistake somewhere.
If you prefer me to post a new issue, I certainly can.

Andreas Lehmkühler
added a comment - 03/Oct/11 13:49 I fixed the issue in revision 1178412, but I didn't use Simons patch, as It was just a workaround. Separation-colorspaces had a similar issue, see PDFBOX-963 for further details.
Thanks for the pointer and the detailed description, it made it easy for me to fix this issue !