[ pdf ] editing

> > I guess if it’s really importent one would buy acrobat and see if it
> > could run under wine. Does all of the above and then some. But then
> > it
> > does cost about 100 USD so it had better do it.
> > No thanks. :> I will use the “keep the source handy” route.
>
OK, a similar task of working with PDFs was keeping me busy today. I solved it
using only open-source tools.

There was a scientific article (available only as a PDF) with some plots. I
had to translate the most important parts of it into Russian and insert the
result into my own reviwe paper. I also had to include those plots into my
review.

The translation was easy. And I managed to get all the plots as EPS files. The
solution is outlined below.

1) Convert the page containing the plot from pdf to ps.

$ pdftops -f 2 -l 2 article.pdf
Result: article.ps contains the second page (with the plot).

2) Convert the PostScript file to Adobe Illustrator format (i.e. flatten it).
a) If you want to get text as outlines, not as letters (saves from “Unknown
font” warnings later):
$ echo “/joutln true def” >opts.ps
Otherwise:
$ touch opts.ps
b) The actual conversion (the file ps2ai.ps is in
/usr/share/ghostscript/7.05/lib, gs knows about it):
$ gs -dBATCH -dQUIET -dNODISPLAY opts.ps ps2ai.ps article.ps >article.ai
Result: the file article.ai contains an editable version of the page, using
only a small subset of PostScript.

3) Build sketch (you need Python, the rest is explained in the README file.
You don’t want the development version.) Run it:

$ sketch article.ai

Ignore the warning about the file not being an Illustrator file. Remove the
text around the plot. Remove all other unnecessary drawings. Add an arrow to
point to the discrepancy between the theory and the experiment. Add some text,
arrows, do anything you want (I added the word “Discrepancy”, sketch does
not allow to add text outside ISO-8859-1, but this is not a problem because a
LaTeX package “PSfrag” exists and allows you to replace strings in the eps
file with anything).

Of course, you can fill in the form this way.

4) Save the file as PostScript, rename to .eps
5) Use the eps file as you want. Convert it to pdf using ps2pdf, or insert it
in a LaTeX document (as I did).

Karbon 1.4 (part of KOffice beta) also pretends that it allows to edit Adobe
Illustrator files. It just pretends, don’t use it.

source : linuxfromscratch

  • muti
  • del.icio.us
  • blogmarks
  • Digg
  • Pownce
  • Reddit
  • TwitThis

Category: all, computer, english, linux


Leave a Reply