You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Jens Vogt (JIRA)" <ji...@apache.org> on 2013/05/16 10:35:15 UTC
[jira] [Created] (PDFBOX-1599) ConvertToImage gets
ClassCastException with Checkboxes in PDFForm
Jens Vogt created PDFBOX-1599:
---------------------------------
Summary: ConvertToImage gets ClassCastException with Checkboxes in PDFForm
Key: PDFBOX-1599
URL: https://issues.apache.org/jira/browse/PDFBOX-1599
Project: PDFBox
Issue Type: Bug
Components: PDModel
Affects Versions: 1.8.1
Environment: Windows Vista, Java 1.6
Reporter: Jens Vogt
Priority: Critical
Fix For: 1.8.1
When creating an image from a PDF Form we get an CastCastException in:
Exception in thread "main" java.lang.ClassCastException: org.apache.pdfbox.cos.COSName cannot be cast to org.apache.pdfbox.cos.COSStream
at org.apache.pdfbox.pdmodel.interactive.annotation.PDAppearanceDictionary.getNormalAppearance(PDAppearanceDictionary.java:103)
at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:140)
at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:781)
at org.apache.pdfbox.examples.util.Extraction$BarcodeLocator.getBarcode(Extraction.java:418)
at org.apache.pdfbox.examples.util.Extraction$BarcodeLocator.access$000(Extraction.java:379)
at org.apache.pdfbox.examples.util.Extraction.<init>(Extraction.java:103)
at org.apache.pdfbox.examples.util.Extraction.main(Extraction.java:138)
An further analysis shows that it seems to be related to checkboxes on the PDF Form. I fixed it temporarily using:
try
{
COSStream as = (COSStream)map.getDictionaryObject( asName );
actuals.put( asName.getName(), new PDAppearanceStream( as ) );
}
catch (ClassCastException ex)
{
System.err.println("Exception name: " + asName.getName());
}
in PDAppearanceDictionary.java.
Best regards
Jens
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira