[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PDF reader that overrides fonts



2008/6/7 Florian Kulzer <florian.kulzer+debian@icfo.es>:
> #! /bin/bash
> #
> # pdfstripsfonts: a simple wrapper script that invokes ghostscript
> # to remove all embedded fonts from a PDF document (work in progress)
>
> if [ -z "$1" ]
>  then echo "Usage: ${0##*/} input_pdf [output_pdf]"
>  exit 1
> fi
> INFILE="$1"
>
> if [ -z "$2" ]
>  then OUTFILE="${INFILE%.pdf}-NOFONTS.pdf"
>  else OUTFILE="$2"
> fi
>
> FONTS="$(pdffonts "$INFILE" | awk 'NR>2{ORS=" ";print "/"$1}')"
>
> gs -q -dSAFER -dNOPAUSE -dBATCH \
>   -sDEVICE=pdfwrite -sOutputFile="$OUTFILE" \
>   -c ".setpdfwrite <</NeverEmbed [$FONTS]>> setdistillerparams" \
>   -f "$INFILE"
>

Thank you Florian. The script may not be UTF-8 compatible, as none of
the letters appeaar at all after running through the script.

Going back to Inkscape, which is the only solution that I have yet to
find to display the file properly without the offending font, I have
found that the program can export to PS just fine. Thus, I have a
single-page PS file with the correct font and letterspacing. Exporting
to PDF from Inkscape produces terrible letterspacing, even when
configuring relevant options to correct that.

Now, I am only faced with converting 20 PDF files, ten pages each, one
page at a time! I am afraid that the pressure of the upcoming exam
(for which I am reading these files in the first place) will cause me
to delay my learning of the Inkscape scripting abilities until after
the exam. I will, however, update this thread when (if) I do come to a
conclusion and succeed in crafting a method of reliably removing
embedded fonts from PDF documents.

Thank you Florian, and Mumia, and everyone else who got me this far.
We have explored a lot of options, and learned much.

Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Reply to: