Font issue with PDFtk

前端 未结 2 1103
野的像风
野的像风 2021-02-05 06:26

I\'m having difficulties filling in a form using pdftk with text fields with true type fonts.

  • Font files (.ttf) are added to /Library/Fonts (OSX Maver
2条回答
  •  悲&欢浪女
    2021-02-05 07:24

    I was getting the same java.lang.ArrayIndexOutOfBoundsException: 0 error using pdftk to fill forms on an Adobe Acrobat generated PDF. This question is super old, but I couldn't find a consistent answer on stackoverflow 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 it

    4. Running the PDF through pdftk again

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

提交回复
热议问题