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/07/06 13:22:33 UTC

[jira] [Commented] (PDFBOX-2183) COSArray cannot be cast to COSNumber

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

Tilman Hausherr commented on PDFBOX-2183:
-----------------------------------------

Excerpt from your PDF (when uncompressed):
{code}
/Rect [ [ 165.15 186.18 289.54 199.68 ] ] 
{code}

It should be
{code}
/Rect [ 165.15 186.18 289.54 199.68 ]
{code}

I added a check that the rectangle is really a rectangle in rev 1608184 for the trunk. You'll see this:
{code}
WARN  [main] org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation:220 - COSArray{[COSArray{[COSFloat{165.15}, COSFloat{186.18}, COSFloat{289.54}, COSFloat{199.68}]}]} is not a rectangle array, returning null
{code}

> COSArray cannot be cast to COSNumber
> ------------------------------------
>
>                 Key: PDFBOX-2183
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2183
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>         Attachments: input.pdf
>
>
> java -jar ~/pdf-box-svn/app/target/pdfbox-app-2.0.0-SNAPSHOT.jar PDFToImage input.pdf
> Exception in thread "main" java.lang.ClassCastException: org.apache.pdfbox.cos.COSArray cannot be cast to org.apache.pdfbox.cos.COSNumber
> 	at org.apache.pdfbox.cos.COSArray.toFloatArray(COSArray.java:530)
> 	at org.apache.pdfbox.pdmodel.common.PDRectangle.<init>(PDRectangle.java:97)



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