I have a PDF form that I have set up to send (X)FDF data to a php script, that uses PDFTK to parse the (X)FDF data and flatten it, then save it as a PDF on my system (for testing). Everything functions normally in Adobe Acrobat Pro.
But when I use Google Chrome to submit the form, the PDF does not get created. It outputs FDF data, but when I try XFDF, it still only outputs FDF, and when I run the FDF data through PDFTK manually, I get this error:
java.lang.ClassCastException: pdftk.com.lowagie.text.pdf.PdfDictionary cannot be cast to pdftk.com.lowagie.text.pdf.PdfString
at pdftk.com.lowagie.text.pdf.FdfReader.readFields(FdfReader.java:148)
at pdftk.com.lowagie.text.pdf.FdfReader.readPdf(FdfReader.java:117)
at pdftk.com.lowagie.text.pdf.PdfReader.<init>(PdfReader.java:172)
at pdftk.com.lowagie.text.pdf.PdfReader.<init>(PdfReader.java:161)
at pdftk.com.lowagie.text.pdf.FdfReader.<init>(FdfReader.java:74)
at com.gitlab.pdftk_java.TK_Session.create_output(TK_Session.java:2598)
at com.gitlab.pdftk_java.pdftk.main_noexit(pdftk.java:158)
at com.gitlab.pdftk_java.pdftk.main(pdftk.java:130)
There was a problem with pdftk-java. Please report it at
https://gitlab.com/pdftk-java/pdftk/issues
including the message above, the version of pdftk-java (3.1.2), and if possible steps to reproduce the error.
Any ideas on how to get the form working in Google Chrome?
This is a necessity for usability, I don't want to have my customers download Adobe Reader, but if it must be done, it must be done.
Turns out it was a bug in pdftk: https://gitlab.com/pdftk-java/pdftk/-/issues/56