How do I embed fonts in an existing PDF?

后端 未结 4 733
無奈伤痛
無奈伤痛 2020-12-05 06:49

Background:

I have PDF\'s I am programmatically generating. I need to be able to send the PDF directly to a printer from the server (not through an

4条回答
  •  Happy的楠姐
    2020-12-05 07:45

    This may not be the answer you are looking for (since you want to get your problems solved programmatically, not by an external tool).

    But you can use Ghostscript commandline to embed missing fonts in retrospect to PDFs which have not embedded them:

    gs \
      -sFONTPATH=/path/to/fonts:/another/dir/with/more/fonts \
      -o output-pdf-with-embedded-fonts.pdf \
      -sDEVICE=pdfwrite \
      -dPDFSETTINGS=/prepress \
       input-pdf-where-some-fonts-are-not-embedded.pdf
    

    One important thing is that the missing fonts are all available in one of the directories pointed to by the -sFontPath=... switch.

提交回复
热议问题