I use
PDFtk version 2.02 : https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg
macOS 10.3.1
When I try to generate a PDF with
/usr/local/bin/pdftk /path/to/original.pdf fill_form
/var/folders/d6/5yq98bvd47990wqy71cpd6cw0000gn/T/pdf_forms-fdf20171128-
7161-7za1zt output
/var/folders/d6/5yq98bvd46990wqy71cpd6cw0100gn/T/d20171128-7161-
1fzq7t7/fillpdf20171128-7161-vcmumq.pdf
I get this error:
PdfForms::PdftkError (failed to fill form with command
/usr/local/bin/pdftk /path/to/original.pdf fill_form
/var/folders/d6/5yq98bvd47990wqy71cpd6cw0000gn/T/pdf_forms-fdf20171128-
7161-7za1zt output
/var/folders/d6/5yq98bvd46990wqy71cpd6cw0100gn/T/d20171128-7161-
1fzq7t7/fillpdf20171128-7161-vcmumq.pdf
command output was:
Unhandled Java Exception in create_output():
java.lang.ArrayIndexOutOfBoundsException: 0
at pdftk.com.lowagie.text.pdf.DocumentFont.fillEncoding(pdftk)
at pdftk.com.lowagie.text.pdf.DocumentFont.doType1TT(pdftk)
at pdftk.com.lowagie.text.pdf.DocumentFont.<init>(pdftk)
at pdftk.com.lowagie.text.pdf.AcroFields.getAppearance(pdftk)
at pdftk.com.lowagie.text.pdf.AcroFields.setField(pdftk)
at pdftk.com.lowagie.text.pdf.AcroFields.setFields(pdftk)
Note: the generation works on Ubuntu.
The solution I found is to open /path/to/original.pdf
with preview and save it (git show a modification) but when I send this pdf to universign.com, universign report an error (and it work with Ubuntu with the original pdf).
EDIT 2017-11-29 :
Open and save the PDF with Preview than with Adobe Reader (this version) seems to solve the problem.