[OS X TeX] Re: svg to pdf
Jens Noeckel
noeckel at uoregon.edu
Tue Jul 11 18:18:37 CEST 2006
On Jul 10, 2006, at 8:06 PM, Jens Noeckel wrote:
>
> #!/bin/csh
> inkscape --print='| pstopdf -i -o '`basename -s svg "$1"`pdf "$1"
>
> This takes one argument: an SVG filename. It requires that a
> command-line inkscape (e.g., fink's) be installed. It writes a pdf
> file with the same base name as the input file. Just copy the above
> two lines to a file called svg2pdf in your PATH and make it
> executable (e.g., chmod 700 svg2pdf).
>
> That's all. I initially had some problems with this because fink's
> inkscape installation had a snafu, but the only thing a fink user
> has to do to install inkscape is to type the following:
> sudo fink install inkscape
> sudo fink install gnome-vfs2-ssl
>
Here are two amendments to my earlier email (to avoid frustration in
case anyone is going to try it):
1)
during the fink installation of inkscape, you have to choose between
two versions of gnome-vfs packages - with or without "ssl". The
choice doesn't matter, but if you don't choose the ssl version there,
then leave out the "ssl" from the command "sudo fink install gnome-
vfs2-ssl" I quoted above.
2)
The script I came up with above seems to rotate the graphic (pstopdf
is to blame for that). To avoid this, I've made the script a little
longer by retreating to the good old ghostscript itself:
#!/bin/csh
inkscape --print='| gs -dNOPAUSE -q -dBATCH -sDEVICE=pdfwrite -
sOutputFile='`basename -s svg "$1"`pdf' - -c quit' "$1"
(this is still a two-line script)
That should take care of it. You may ask why I chose /bin/csh above,
instead of /bin/sh. The answer is: it's completely irrelevant.
Jens
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
More information about the macostex-archives
mailing list