Joe,
I apologize for contacting you here, but I have tried every other means I could find and got no response.
Could you please take a moment to help me with using XFDF files with PDFtk?
I'm running pdftk 2.02 on macOS 10.12.6.
You wrote a great blog back in 2014 that was very helpful to me:
Filling PDF forms with PDFtk, XFDF, and XQuery
Unfortunately, I get a fatal error when trying to fill a PDF from a XFDF. The same PDF works fine with a FDF file, but I now need to handle high-end Unicode characters that appear in non-English languages. So, I have to use XFDF.
Here is the error I get:
$ pdftk ExamplePDF.pdf fill_form ExampleData.xml output filltest1.pdf
Unhandled Java Exception in create_output():
java.lang.RuntimeException: Root element is not Bookmark.
at pdftk.com.lowagie.text.pdf.XfdfReader.startElement(pdftk)
at pdftk.com.lowagie.text.pdf.SimpleXMLParser.parse(pdftk)
at pdftk.com.lowagie.text.pdf.SimpleXMLParser.parse(pdftk)
at pdftk.com.lowagie.text.pdf.XfdfReader.(pdftk)
This is using the PDF form that Sid provided in his download, and your example XFDF.
Both are attached. Importing to the same PDF and using the same XFDF file with AdobeAcrobat Pro works fine.
I get the same exact error with my form and data, yet when I use Adobe Acrobat Pro X to import to the form using the same XFDF file, it works fine.
I've searched and searched, and cannot get any info on this error.
I'm running pdftk 2.02 on macOS 10.12.6.
Can you offer any help?
$ pdftk ExamplePDF.pdf fill_form ExampleData.xml output filltest1.pdf
Unhandled Java Exception in create_output():
java.lang.RuntimeException: Root element is not Bookmark.
at pdftk.com.lowagie.text.pdf.XfdfReader.startElement(pdftk)
at pdftk.com.lowagie.text.pdf.SimpleXMLParser.parse(pdftk)
at pdftk.com.lowagie.text.pdf.SimpleXMLParser.parse(pdftk)
at pdftk.com.lowagie.text.pdf.XfdfReader.<init>(pdftk)
I have no idea what the errors mean, or how to fix.
This is using the PDF form that Sid provided in his download, and your example XFDF.
Both are attached. Importing to the same PDF and using the same XFDF file with AdobeAcrobat Pro works fine.
I get the same exact error with my form and data, yet when I use Adobe Acrobat Pro X to import to the form using the same XFDF file, it works fine.
I've searched and searched, and cannot get any info on this error.
Example PDF and XFDF Files.zip
Can you offer any help?