[OS X TeX] Re: svg to pdf

Ross Moore ross at ics.mq.edu.au
Sat Jul 15 00:00:34 EDT 2006


On 13/07/2006, at 1:08 AM, Alain Schremmer wrote:

> Ross Moore wrote:
>
>> Hi Alain,

>> I've spent several hours last Saturday trawling the web for
>> SVG-->PDF converters.
>
> So have I and, from what I have seen, so have many others, and all,  
> it seems to no avail. At least as far as OS X is concerned. The  
> situation is a bit incredible.

It turns out that there *is* a solution that is
immediately available:  Inkscape

   http://www.inkscape.org/

It's OpenSource, available for Linux, Windows and Mac .


For MacOS X there's a .dmg  to download.
Drag the application to your  Applications  folder.
The path to the actual executable is then:

   /Applications/Inkscape.app/Contents/Resources/bin/inkscape

Conversions can be run from the command-line, hence as  \write18
commands from a TeX job.


It's still under development --- currently version 0.44 .
I couldn't get it to launch as an X11 application, but that
is no hindrance to command-line use.

To run a conversion to .eps  (on a file  newlion.svg  say) from
the command-line, do the following commands:


/Applications/Inkscape.app/Contents/Resources/bin/inkscape -z -E  
newlion.eps  newlion.svg
epstopdf newlion.eps
rm newlion.eps


The -z option stops any attempt to use a GUI.
The -E option is for .eps output; ( -P is for unencapsulated .ps ).
There's no direct mode for PDF, but  epstopdf  uses Ghostscript
to manage that step.  Apple's  pstopdf  is an alternative.


Beware that there are some warnings produced; namely:

(inkscape-bin:15546): Gtk-WARNING **: Locale not supported by C library.
         Using the fallback 'C' locale.

(inkscape-bin:15546): Gdk-CRITICAL **: gdk_display_list_devices:  
assertion `GDK_IS_DISPLAY (display)' failed


  ... but these don't seem to affect the output.


To shorten the command required, place a 1-line script in a
standard place on your path for programs; e.g.

[GlenLivet:] rossmoor% more /usr/local/bin/inkscape
/Applications/Inkscape.app/Contents/Resources/bin/inkscape $*

After a  rehash  the 1st command in the above example becomes:

    inkscape -z -E newlion.eps  newlion.svg

Note that it is *not* enough to use a symbolic link!



There is a manual. A quick browse reveals that not everything
is supported for  SVG --> (Encapsulated) PostScript ;
e.g.  no transparency,  fonts not embedded .
So it's not a complete solution; but otherwise pretty good.


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------


------------------------- 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 MacOSX-TeX mailing list