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

Tilman Hausherr commented on PDFBOX-1724:
-----------------------------------------

According to https://github.com/mozilla/pdf.js/issues/252 the mozilla viewer 
uses DeviceGray instead. I've set PDColorSpaceFactory to return a 
PDDeviceGray() object

{code}
            if( name.equals( PDCalGray.NAME ) )
            {
                // PDFBOX-1724
                // https://github.com/mozilla/pdf.js/issues/252
                //retval = new PDCalGray( array );
                log.warn("CalGray not implemented, using DeviceGray instead, 
see PDFBOX-1724");
                
                retval = new PDDeviceGray(); //TH
            }
{code}

IMHO a slightly wrong text color is better than no text at all. Especially 
considerung that the current implementation of ColorSpaceCalRGB ignores gamma, 
whitepoint, blackpoint or matrix values :-)

> Method createColorModel not implemented for PDCalGray
> -----------------------------------------------------
>
>                 Key: PDFBOX-1724
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1724
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 1.8.2
>            Reporter: Mark Hansohm
>            Priority: Minor
>         Attachments: problem_pdf.pdf
>
>
> The method createColorModel is not implemented for the class PDCalGray - when 
> called, it throws an IOException(!):
> {noformat}
>  /**
>      * Create a Java colorspace for this colorspace.
>      *
>      * @return A color space that can be used for Java AWT operations.
>      *
>      * @throws IOException If there is an error creating the color space.
>      */
> protected ColorSpace createColorSpace() throws IOException
>     {
>         throw new IOException( "Not implemented" );
>     }
> {noformat}
> The exception thrown is catched elsewhere (by an aspect?) but it leads to an 
> ugly stacktrace in the logfile .. :
> {noformat}
> 2013-09-24 09:32:11,858 ERROR - PDPixelMap : java.io.IOException: Not 
> implemented
> java.io.IOException: Not implemented
>       at 
> org.apache.pdfbox.pdmodel.graphics.color.PDCalGray.createColorModel(PDCalGray.java:114)
>       at ...
>       at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:781)
> ....
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to