A patch to fix this issue is provided. Be sure to review it... this is my first contribution.
I tried to solve jira issue
PDFBOX-1058 (to contribute a bit) and tried to convert the file referenced in this ticket to images using standard utilities and I got lots of NullPointerExceptions.
1) These NPE occurs because the java color space returned by the PDDeviceN doesn't take the tint transformation function into account. When the toRGB method method of the color space (ColorSpaceCMYK for the pdf file linked to
PDFBOX-1058) is called it returns null because the length of the array is not of the expected size. This occurs because the tint transformation function is not called. The provided patch fix this.
2) By debugging this, I also got CastException because I called get/setColorantName method that were declared to return list of COSBase. In reality they returned list of Strings. To avoid these kind of errors in the future, I also introduced generics in the COSArrayList data type. This is also provided in the patch.
PDFBOX-1058 is still not fully fixed by the patch. Colors still looks horrible on some parts. I'm working on it...
However, by applying the patch there is a clear quality improvement (xerox logo on the upper left part of the first page and wave effect in the middle of the first page).