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

Tilman Hausherr commented on PDFBOX-4084:
-----------------------------------------

I'll fix the classcastexception, but the first file is broken. Here's object 38:
{code}
38 0 obj
<</Annots 64 0 R/Contents 88 0 R/CropBox [0 0 595.22 842]/MediaBox [0 0 595.22 
842]/Parent 33 0 R/Resources <</ExtGState <</GS2 93 0 R/GS3 94 0 R>>/Font <</F1 
87 0 R/TT10 51 0 R/TT2 40 0 R/TT4 41 0 R/TT6 42 0 R/TT8 49 0 R>>/ProcSet [/PDF 
/Text /ImageC /ImageB /ImageI]/XObject <</Im245 59 0 R/Im247 61 0 R/X1 89 0 
R/X2 90 0 R>>>>/Rotate 0/Thumb 103 0 R/Type /Page>>
endobj
{code}
The object 64 exists twice in the PDF. Once as annotation array, once as font.

Yes there is a specification (compressed object streams) to store things as a 
stream, but this is not new and we support it.

What is with the second file? "This also happens in getPages or something else 
(See the second attachment)." Is this the same issue?

> Can't draw PDFs while ANNOTS is COSStream instead of COSArray
> -------------------------------------------------------------
>
>                 Key: PDFBOX-4084
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4084
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.8
>            Reporter: Cheng Zhong
>            Priority: Major
>         Attachments: Benelux Equity Daily-20110321.pdf, TELECOM EQUIPMENT 
> DAILY - 12 AUG 2009.pdf
>
>
> PDFBox would failed to draw the attached document , error logs are below:
> {code:java}
> java.lang.ClassCastException: org.apache.pdfbox.cos.COSStream cannot be cast 
> to org.apache.pdfbox.cos.COSArray
> at org.apache.pdfbox.pdmodel.PDPage.getAnnotations(PDPage.java:661) 
> ~[classes/:?]
> at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:202) 
> ~[classes/:?]{code}
> This PDF put COSStream as the page's ANNOTS object, and caused the failure.
> Simply do type checks in PDPage.getAnnotations might avoid this issue, but 
> the annotations would lost.
>  
> This PDF show correctly (I mean annotation works) in:
>  * Chrome 63.0.3239.132
>  * Adobe Reader 11.0.23
> This PDF doesn't work perfectly in:
>  * Microsoft Edge
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to