On 06/06/2008 12:02 PM, Florian Kulzer wrote:
[...] Here is an extremely quick-and-dirty, I-guarantee-for-nothing (!) bash script to remove embedded fonts. It takes only one argument, the name of the original PDF file, and it generates "...-NOFONTS.pdf". I only tested this on one PDF file that I happened to have lying around, so I have no idea how robust this is: #! /bin/bash TEMPPSFILE="${1%.pdf}-TEMP.ps" FONTS="$(echo $(pdffonts "$1" | awk 'NR>2{print "/"$1}'))" echo ".setpdfwrite <</NeverEmbed [$FONTS]>> setdistillerparams" > "$TEMPPSFILE" pdftops "$1" - >> "$TEMPPSFILE" gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -o "${1%.pdf}-NOFONTS.pdf" -f "$TEMPPSFILE" rm "$TEMPPSFILE"
I ran Dotan's file through Florian's script, but the resulting file seems to still use the handwriting font.
This is what the $TEMPPSFILE looks like at the top:
.setpdfwrite <</NeverEmbed [/CHBAKA+TimesNewRomanPSMT /CHBALP+GuttmanYad-Brush /CHBANO+GuttmanYad-Brush /CHBAPN+GuttmanYadLight /CHBBAI+GuttmanYadLight /TimesNewRomanPS-BoldMT /ArialMT /TimesNewRomanPS-ItalicMT /CHBCAA+SymbolMT /CHBKLK+MT-Extra /Arial-BoldMT /CHAPKP+TimesNewRomanPSMT]>> setdistillerparams %!PS-Adobe-3.0 %%Creator: xpdf/pdftops 3.01 %%LanguageLevel: 2 %%DocumentSuppliedResources: (atend)
Perhaps the .setpdfwrite command should be below the %!PS-Adobe-3.0 statement, but I wouldn't know where to put it.