You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tim Allison (JIRA)" <ji...@apache.org> on 2014/05/16 12:32:01 UTC

[jira] [Updated] (PDFBOX-1756) ClassCastException CosString cannot be cast to COSName

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

Tim Allison updated PDFBOX-1756:
--------------------------------

    Attachment: testPDF_twoAuthors.pdf

Shareable test document from TIKA-1252.  Same issue.

> ClassCastException CosString cannot be cast to COSName
> ------------------------------------------------------
>
>                 Key: PDFBOX-1756
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1756
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 1.8.2
>         Environment: Ubuntu Linux & Windows 7 (both JDK6)
>            Reporter: William Palmer
>            Priority: Minor
>         Attachments: testPDF_twoAuthors.pdf
>
>
> Opening and saving a PDF causes this exception in 1.8.2:
> Exception in thread "main" java.lang.ClassCastException: org.apache.pdfbox.cos.COSString cannot be cast to org.apache.pdfbox.cos.COSName
> 	at org.apache.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWriter.java:507)
> 	at org.apache.pdfbox.pdfwriter.COSWriter.doWriteBody(COSWriter.java:435)
> 	at org.apache.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:1122)
> 	at org.apache.pdfbox.cos.COSDocument.accept(COSDocument.java:552)
> 	at org.apache.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1501)
> 	at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1324)
> 	at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:1305)
> The PDF is here: http://digitalcorpora.org/corp/nps/files/govdocs1/008/008677.pdf
> Code to reproduce the exception:
> PDFParser parser = new PDFParser(new FileInputStream(new File("008677.pdf")));
> parser.parse();
> File temp = File.createTempFile("temp-", ".pdf");
> parser.getPDDocument().save(temp);
> parser.getDocument().close();



--
This message was sent by Atlassian JIRA
(v6.2#6252)