[
https://issues.apache.org/jira/browse/PDFBOX-2940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maruan Sahyoun resolved PDFBOX-2940.
------------------------------------
Resolution: Fixed
> 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
> Assignee: Maruan Sahyoun
> 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]