Re: PDF reader that overrides fonts



On Fri, Jun 06, 2008 at 18:37:35 +0300, Dotan Cohen wrote:
2008/6/6 Florian Kulzer:
I think inkscape is by far the best tool for this job, provided that you
use version 0.46 (available in Lenny and Sid). It can read PDFs directly
and convert their content to fully-editable text blocks, vector graphics
or embedded bitmaps (depending on how the individual elements were
embedded in the original PDF). It will probably replace the embedded
non-standard font with a standard one automatically. You should then be
able to change font size, positioning of the text blocks, etc. as if you
had created this document yourself with inkscape. If you find that the
spacing of the letters is strange then you might have to make use of
"Text > Remove Manual Kerns".


Thank you, Inkscape opens the documents in the Tahoma font, which is
perfectly legible. However, saving back as pdf ruins the letter
spacing as you mention, yet, removing the manual kerns does not help.
Also, this only saves the first page of the document.

You can select which page is opened, but you cannot edit more than one
page at once.

1) Is there another way to change the letter spacing? Even selecting
the entire document and then selecting a specific font did not help
with letter spacing.

I have to admit that I don't know why removing the manual kerns does not
work sometimes. I mostly use inkscape's PDF import to get at some vector
graphic that is important for me.

2) Can Inkscape work with more than a single page? I have 20
documents, 10 pages on average each, and the test is next week!

OK, then you need another approach. What might work in a reasonably
scalable way is to distill the PDF into another PDF while removing all
the embedded fonts. Then your PDF viewer should choose a suitable
standard font as a substitute (probably also Tahoma) whenever you open
the new PDF file.

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"

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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages