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

Re: PDF reader that overrides fonts

On Fri, Jun 06, 2008 at 21:48:32 +0300, Dotan Cohen wrote:
> 2008/6/6 Florian Kulzer:
> > You can select which page is opened, but you cannot edit more than one
> > page at once.
> That's going to be a problem 20 documents (10 pages each) a week
> before the final exam!
> > 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"
> >
> Thank you, Florian! The script failed to remove the font from this
> particular pdf, however.

I don't like this at all; we will have to do something about this...

> I must say that I am impressed and I see that
> you've combined quite a few tools there. If you feel like a challenge,
> and don't mind Dotan taking advantage of that, then I could send to
> you one of the pdf files to perfect your script on.

Yes, please send me an example file. (Remove the "+debian" from the
email address that I use to post on this list to bypass my most
aggressive spam filters. If you think that it is necessary to encrypt
the mail then you can use my public key 196FCE3C.)

Regards,            | http://users.icfo.es/Florian.Kulzer
          Florian   |

Reply to: