[ACCEPTED]-Font issue with PDFtk-pdftk

Accepted answer
Score: 22

I was getting the same java.lang.ArrayIndexOutOfBoundsException: 0 error using pdftk to 9 fill forms on an Adobe Acrobat generated 8 PDF. This question is super old, but I couldn't 7 find a consistent answer on stackoverflow 6 or elsewhere so I figured I'd post my fix.

What ended up working for me:

  1. Opening the PDF in the OS X app Preview
  2. Clicking into a form field, adding text then deleting that text (so nothing is actually changed)
  3. Saving 5 it

  4. Running the PDF through pdftk again

I'm not 4 that familiar with encoding or PDFs in general, but 3 saving the PDF with Preview seems to fix 2 the encoding or at least get it to a place 1 where pdftk can work with it. Good luck.

More Related questions