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

[jira] [Commented] (PDFBOX-1762) org.apache.pdfbox.cos.COSInteger cannot be cast to org.apache.pdfbox.util.PDFOperator

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

Tilman Hausherr commented on PDFBOX-1762:
-----------------------------------------

The PDF, and the stream are broken. Here's the stream that PDFStreamParser doesn't like:
{code}
BI
/W 2
/H 2
/BPC 1
/IM true
/D [ 1 0 ] 
ID ÀÀ
EI
Q 
q 
3 
q 
4.5 0 
0.9216 0.85498W 2
/H9176 0.85BPC 1
/IM true
 true
 true
 true
 true
 true
 true
 true
 true
 true
 true
 true
 true
 true
 true
B
 true
BI
/W 2
/H 1
/BPC 1
/IM true
/D [ 1 0 ] 
ID À
EI
{code}
starting with the line "0.9216 0.85498W 2", it doesn't make sense anymore "/W 2" is a correct command, but "0.9216 0.85498W 2" isn't and it gets worse from there. There's a comment by Andreas or Timo in another of your issues, that he thinks that two threads wrote on the same output at the same time.

> org.apache.pdfbox.cos.COSInteger cannot be cast to org.apache.pdfbox.util.PDFOperator
> -------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-1762
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1762
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 1.8.2
>         Environment: JDK6
>            Reporter: William Palmer
>            Priority: Minor
>
> The following exception is reported for the test file (using the code samples in PDFBOX-1757 with load() and loadNonSeq())
>  -http://digitalcorpora.org/corp/nps/files/govdocs1/492/492484.pdf
> 	java.lang.ClassCastException: org.apache.pdfbox.cos.COSInteger cannot be cast to org.apache.pdfbox.util.PDFOperator
> 	at org.apache.pdfbox.pdfparser.PDFStreamParser.parseNextToken(PDFStreamParser.java:371)
> 	-with loadnonseq
> 	java.io.IOException: Error: Expected an integer type, actual='n'
> 	at org.apache.pdfbox.pdfparser.BaseParser.readInt(BaseParser.java:1622)
> 	at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parseXrefObjStream(NonSequentialPDFParser.java:459)
> 	at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.initialParse(NonSequentialPDFParser.java:359)
> 	at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parse(NonSequentialPDFParser.java:700)



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