Skip to content

Instantly share code, notes, and snippets.

@sampsyo
Created May 25, 2014 17:07
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sampsyo/898489dd2672c5d1af36 to your computer and use it in GitHub Desktop.
embed fonts into PDFs, painlessly
#!/bin/sh
infn=$1
outfn=`basename $infn .pdf`.still.pdf
# Embed fonts.
gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outfn \
-dCompatibilityLevel=1.5 -dPDFSETTINGS=/prepress -c .setpdfwrite -f $infn
# Strip metadata crap added by Ghostscript.
exiftool -Title="" $outfn
exiftool -Creator="" $outfn
exiftool -CreatorTool="" $outfn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment