0

I use

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.

ludovicl
  • 1
  • 2
  • 1
    Every time I see my name in an error message, I wonder why people punish themselves by using source code that I wrote at a time when I didn't know how to write code. PdfTk uses an old version of a library that was completely rewritten from scratch. That old version should no longer be used. I've been telling this over and over again, but unfortunately, people just don't want to listen to me. Maybe they don't believe that I'm the lowagie who is mentioned in [com.lowagie](http://lowagie.com). – Bruno Lowagie Nov 28 '17 at 17:56
  • @BrunoLowagie May PDFtk hear you! – ludovicl Nov 28 '17 at 19:33

0 Answers0