Let’s imagine you have to merge several PDF files that your colleagues sent you into a single, larger document. Let’s then imagine that your idea is to publish this document, but the publisher requires all fonts to be embedded in the document. Unfortunately, your PDF file does not have all the fonts embedded, as you can check with the following command:
$pdffonts document.pdf
name type emb sub uni object ID
(...)
Helvetica Type 1 no no no 697 0
(...)
You do not want to bother your colleagues by shifting the problem to them - they already sent you their PDFs and you initially forgot to ask them to embed the fonts. Furthermore, you’d rather use free software that is available in your mainstream linux distribution. Preferably a command-line program which you can call from a makefile or a script.
Well, then, this is The Command:
$gs -dSAFER -dNOPLATFONTS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=letter -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=output.pdf -f input.pdf
It took a lot of time, almost ate up all my workstation’s memory but it did work. Credit goes to this guy. Further useful information here.
One Comment
Thanks for writing this.
Post a Comment