pdftk loses form fields when merging pdf files generated by wkhtmltopdf
Hi everyone,
I've been scratching my head about this issue for a few days and I'm hoping some collective wisdom might help. It looks like pdftk is nuking my form fields, they also don't show up in Adobe reader (BUT they are somewhat visible in some other PDF products like Kofax PDF, or even Google Chrome). Ultimately I'm sending them to DocuSign whose API says the fields don't exist, so I expect pdftk not recognising them is a sign of the problem.
Here's my minimal repro, you need wkhtmltopdf and pdftk installed:
Versions:
$ pdftk --version
pdftk port to java 3.3.2 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2017-2018 Marc Vinyals - https://gitlab.com/pdftk-java/pdftk
Copyright (c) 2003-2013 Steward and Lee, LLC.
pdftk includes a modified version of the iText library.
Copyright (c) 1999-2009 Bruno Lowagie, Paulo Soares, et al.
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ wkhtmltopdf --version
wkhtmltopdf 0.12.6 (with patched qt
Test HTML:
echo "<html><head></head><body><div>Field: <form><input type=\"text\" value=\"\" name=\"A1_eSignSignHere\"></form></div></body></html>" > sample.html
echo "<html><head></head><body><div>Field: <form><input type=\"text\" value=\"\" name=\"B1_eSignSignHere\"></form></div></body></html>" > sample2.html
To PDF:
wkhtmltopdf --enable-forms sample.html sample.pdf
wkhtmltopdf --enable-forms sample2.html sample2.pdf
Verify form fields (they should appear):
pdftk sample.pdf dump_data_fields
pdftk sample2.pdf dump_data_fields
Merge:
pdftk sample.pdf sample2.pdf output supersample.pdf
No form fields present according to pdftk (BUT they are visible in gnome's default PDF editor, kofax pdf, chrome):
pdftk supersample.pdf dump_data_fields
Does anyone have any idea what might be doing on?