I\'m trying to create a PDF which has a single image on a single page. The tricky part is to use a custom (defined in a separate file) CMYK color space.
I\'ve tried to c
Ok, this seems to be a bug with the first constructor. You could use the second constructor, which uses a COSArray:
The PDF spec explains what to do:
"An ICCBased colour space shall be an array: [/ICCBased stream]"
So you need to create a COSArray, with COSName.ICCBASED as first element, and a COSStream with your ICC data in the second. Create a COSStream and write to it with createFilteredStream(). That COSArray you can use for the second constructor.
Alternatively, just use PDDeviceCMYK.INSTANCE as the colorspace :-)
Update: I have opened issue PDFBOX-2812 and it has been fixed. You can get a snapshot in a few hours here.