[
https://issues.apache.org/jira/browse/PDFBOX-2940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14706483#comment-14706483
]
ASF subversion and git services commented on PDFBOX-2940:
---------------------------------------------------------
Commit 1696918 from [~msahyoun] in branch 'pdfbox/branches/1.8'
[ https://svn.apache.org/r1696918 ]
PDFBOX-2940: don't treat PDAnnotationWidges like PDField avoiding
ClassCastException
> ClassCastException in FDF export
> --------------------------------
>
> Key: PDFBOX-2940
> URL: https://issues.apache.org/jira/browse/PDFBOX-2940
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm
> Affects Versions: 1.8.10
> Reporter: Laurent Richard
> Fix For: 1.8.11
>
> Attachments: formulaire_rempli.pdf
>
>
> We have some simple code extracting FDF from a PDF like
> {code}
> PDDocument pdf = PDDocument.load(inputStream);
> PDAcroForm form = pdf.getDocumentCatalog().getAcroForm();
> FDFDocument fdf = form.exportFDF();
> {code}
> Everything was fine with previous versions of pdfbox (1.8.8 in particular)
> but version 1.8.10 throws an exception :
> {noformat}
> java.lang.ClassCastException:
> org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget cannot be
> cast to org.apache.pdfbox.pdmodel.interactive.form.PDField
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.addFieldAndChildren(PDAcroForm.java:168)
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.exportFDF(PDAcroForm.java:145)
> {noformat}
> I join the sample PDF that was used for this test
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]