Insert font into PDF form

I have a PDF form created by LibreOffice. Because of a known bug in LibreOffice, only a subset of fonts are embedded in the PDF, even when the font is used in form fields. Therefore, the form is not used or the form fields use the wrong leading edge (depending on the PDF viewer) if the font is not installed on the computer.

So I need to replace a subset of the PDF form with the whole font after generation in LibreOffice. Usually using ps2pdf

or is gs

recommended to fix the font issue in pdf. But both programs do not support PDF form. If used in a PDF form, the form fields will be split. I tested it with Ghostscript 9.10 under Unbunt 14.04 LTS.

I can use pdffonts

to display fonts embedded in PDF. But is there also a command line tool to insert a different font into a PDF?

+3


source to share


4 answers


Libreoffice v5.2 embedding fonts for form fields is easy:

Include the font in the form field: () Right click on the form field> Control> Font



Then tell your document to include the fonts in use in its file: () File> Properties> Font tab> Embed Fonts in Document In my case, the file size increases from 50K to 5000K (Using one font with two styles).

Finally, check the PDF options to include fonts in the pdf: () File> Export to Pdf> General Tab: x Enable Create PDF Form (so that the form fields are filled in for the user). Do not select whether both of the following options are needed: x Tagged PDF and x Hybrid PDF: The pdf format will be enlarged later to the size of the LibreOffice file.

+1


source


This is just a workaround: put the edit text box on an invisible and locked page that contains the default string of your likely character set. Although you will still end up with a subset of the font, it will be a substantially larger subset.



0


source


There are a number of commercial solutions that can completely embed the font in the PDF if a commercial application is a viable option for you (they would be expensive to โ€œjustโ€ do it, probably). The two main contenders are probably callas pdfToolbox (beware: I'm related to this product) and Enfocus Pitstop.

0


source


Until the error is resolved, you can use the PDF Toolbelt to fix your forms.

After loading the JAR file, the font of all fields can be reset to the default values โ€‹โ€‹for Adobe Acrobat:

java -jar ./pdf-toolbelt.jar form-font-defaults input.pdf output.pdf

      


Disclaimer: I am the author of the above tool.
0


source







All Articles