[pdftex] PdfTeX and SVG graphics

Ben Crowell pdftexcrowell04 at lightandmatter.com
Tue Nov 9 18:32:06 CET 2004


Wendel Moreira wrote:
>I would like to know if there's a way to convert SVG
>pictures to Pdf format. InkScape save SVG picture as
>Eps, but to convert to Eps the result is the worst
>possible, so by Distiller as by
>PdfWriter(ghostscript).

I'm also very interested in this. I have a series of
textbooks with hundreds of illustrations, and Adobe
Illustrator is the last piece of proprietary software
that I need in order to work on the books. I'm now in
the process of testing whether Inkscape is mature enough
so that I can switch.

So far, I've found three possible ways of creating pdf
from svg, none of which is doing quite what I want:

1. Use Inkscape to save as eps, and then use epstopdf
(which I think is just a wrapper for ghostscript) to
convert to pdf. I'd be interested in hearing more from
Wendel about what version of Inkscape he's using and
what problems he's encountered. The problem I've run
into is that Inkscape 0.38 produces eps output that
causes an error in ghostscript. I reported this as a bug
on Inkscape's sourceforge site, and they responded that
the problem is actually fixed, but that I need to upgrade
to Inkscape 0.39 or 0.40. Since Inkscape 0.40 is due to
be released very soon (probably this week), I'm waiting for
that to happen, and then I'll try this method again. (Inkscape
0.39 is apparently broken on FreeBSD, which is my OS, so I
need to wait for 0.40.) I've actually been using Illustrator
-> eps -> pdf for the illustrations in my books for quite some
time, and have been able to get good results. (There have been
a couple of issues that I've had to work around, which I think
were discussed on this list a year or two ago.) So I don't
think it's true in general that epstopdf must produce bad
results.

2. Use Batik to convert svg to pdf. I've worked on this, but
am encountering some hassles related to getting java working
properly on FreeBSD. If I can overcome that problem, I suspect
this might actually be a good way to go, since Batik gives
the impression of being a fairly mature piece of software,
and it can be run from the command line.

3. Open the svg file in Scribus, and then export it as pdf.
This actually works for me, but I think Scribus may be messing
up the bounding box on the output file. (When I open the file
in xpdf, the window shows the right height, but is wider than
I would have expected. But I need to look at this more carefully
and see if this is really an indication of a problem with the
bounding box.) I'm also not happy with this option because
(a) it's tedious (AFAICT Scribus can't be scripted from the
command line), and (b) it adds another piece of software to the
mix, which increases the complexity of the whole thing and makes
it more likely that certain types of illustrations will get
garbled.

I'm also a little worried that the pdf output I generate may
cause problems when I get the next edition of my books printed.

Yet another option would be simply to use Adobe Illustrator to
convert the svg files to pdf, but my goal is to end my dependence
on proprietary software :-)



More information about the pdftex mailing list