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

CP commented on PDFBOX-1927:
----------------------------

Calling loadNonSeq loads the PDF without an error. 

So why would someone choose loadNonSeq() over load()? (besides wanting to avoid 
this issue)

Doesn't seem obvious when reading the javadocs for the methods.

thanks.

> ClassCastException: COSInteger cannot be cast to COSObject
> ----------------------------------------------------------
>
>                 Key: PDFBOX-1927
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1927
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 1.8.4
>         Environment: Windows 7 64 bit
>            Reporter: CP
>            Priority: Critical
>         Attachments: FlexRiskTrackerPrompt_166.pdf, TestPDFBox.java
>
>
> Calling PDDocument.load("myPDF.pdf") throws ClassCastException.
> I will attach a short sample program and PDF.
> {code}
> 2014-02-19 14:01:11,220 WARN  [org.apache.pdfbox.pdfparser.BaseParser] (main) 
> Invalid dictionary, found: '?' but expected: '/'
> Exception in thread "main" org.apache.pdfbox.exceptions.WrappedIOException
>       at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:263)
>       at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1238)
>       at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1203)
>       at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1128)
>       at 
> com.biosignia.framework.functionalTests.webServices.TestPDFBox.main(TestPDFBox.java:12)
> Caused by: java.lang.ClassCastException: org.apache.pdfbox.cos.COSInteger 
> cannot be cast to org.apache.pdfbox.cos.COSObject
>       at 
> org.apache.pdfbox.pdfparser.PDFParser.readVersionInTrailer(PDFParser.java:859)
>       at 
> org.apache.pdfbox.pdfparser.PDFParser.parseTrailer(PDFParser.java:845)
>       at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:502)
>       at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:194)
>       ... 4 more
> {code>



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

Reply via email to