You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/12/13 20:06:00 UTC

[jira] [Commented] (PDFBOX-3777) org.apache.pdfbox.cos.COSDictionary cannot be cast to org.apache.pdfbox.cos.COSArray

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

ASF subversion and git services commented on PDFBOX-3777:
---------------------------------------------------------

Commit 1884398 from Maruan Sahyoun in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1884398 ]

PDFBOX-3777, PDFBOX-4892: avoid ClassCastException

> org.apache.pdfbox.cos.COSDictionary cannot be cast to org.apache.pdfbox.cos.COSArray
> ------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-3777
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3777
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.5
>            Reporter: John Liston
>            Priority: Minor
>         Attachments: D1790B.PDF
>
>
> {code}
>     public static void main(String[] args) throws IOException
>     {
>         PDDocument.load(new File("D1790B.pdf")).getDocumentCatalog().getAcroForm().getFields();
>     }
> {code}
> throws
> {code}
> Exception in thread "main" java.lang.ClassCastException: org.apache.pdfbox.cos.COSDictionary cannot be cast to org.apache.pdfbox.cos.COSArray
> 	at org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.getFields(PDAcroForm.java:368)
> 	at pdfboxpageimageextraction.PDFBOX3777.main(PDFBOX3777.java:20)
> {code}
> [~msahyoun] wrote in the mailing list
> {quote}
> the field definition in the AcroForm is wrong as the field root is defined as a dictionary and not as an array as it's required by the PDF spec.
> ...
> I think we should fix that as Adobe Reader and another viewer I tested can open the form just fine. So we should do the same.
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org