You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Radim Hatlapatka (Updated) (JIRA)" <ji...@apache.org> on 2012/03/21 21:24:40 UTC

[jira] [Updated] (PDFBOX-1266) When I try to convert certain pages of certain PDF to images I am getting error java.lang.ClassCastException: org.apache.pdfbox.cos.COSNull cannot be cast to org.apache.pdfbox.cos.COSDictionary

     [ https://issues.apache.org/jira/browse/PDFBOX-1266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radim Hatlapatka updated PDFBOX-1266:
-------------------------------------

    Attachment: problematic.pdf

The problematic PDF document for page to image conversion
                
> When I try to convert certain pages of certain PDF to images I am getting error java.lang.ClassCastException: org.apache.pdfbox.cos.COSNull cannot be cast to org.apache.pdfbox.cos.COSDictionary
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-1266
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1266
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.6.0
>         Environment: java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Fedora 16 (and also Debian Squeeze) not tested on other systems
>            Reporter: Radim Hatlapatka
>         Attachments: problematic.pdf
>
>
> Unable to convert certain pages to images for certain PDF documents. Getting error:  java.lang.ClassCastException: org.apache.pdfbox.cos.COSNull cannot be cast to org.apache.pdfbox.cos.COSDictionary
> method for converting page is called this way: BufferedImage image = page.convertToImage(BufferedImage.TYPE_3BYTE_BGR, 300); // where page is of type org.​apache.​pdfbox.​pdmodel.​PDPage
> Full stacktrace (of relevant part):
> java.lang.ClassCastException: org.apache.pdfbox.cos.COSNull cannot be cast to org.apache.pdfbox.cos.COSDictionary
> 	at org.apache.pdfbox.pdmodel.graphics.xobject.PDCcitt.getRGBImage(PDCcitt.java:119)
> 	at org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:78)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:551)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:274)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
> 	at org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:130)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:551)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:274)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
> 	at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225)
> 	at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:107)
> 	at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:722)
> 	at eu.eudml.enhancement.pdf2textviaocr.PdfImageExtractor.extractImagesUsingPdfParser(PdfImageExtractor.java:236)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira