Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting EPS to SVG now that inkscape no longer runs without X

It used to be possible run inkscape from the command line as a convenient tool for convert to and from SVG files. Lots of questions here have answers that suggest running inkscape -z with various other arguments as a tool to do these conversions. Unfortunately this stopped working at some point in the last few years. The -z option is no longer documented and produces a warning that the option is 'deprecated' (in fact, it's simply ignored), and then fails because X is not running:

richard@corruisk:~$ inkscape -z test.eps -l test.svg
Warning: Option --without-gui= is deprecated
Unable to init server: Could not connect: Connection refused

No output SVG file is produced.

I'm certainly not going to run X on my web server, so how else do I convert a EPS file to a SVG file? I've tried using Imagemagick (with potrace installed, and with the security profile modified to support [E]PS conversion), and it produces SVG that none of the web browsers I've tried can read and which Inkscape claims is invalid, though it superficially looks like a valid SVG file.

like image 511
Richard Smith Avatar asked Dec 07 '25 08:12

Richard Smith


1 Answers

It's quite simple: the -z (equal to --without-gui) option is no longer needed. To use Inkscape without GUI, you just define an output file with the -o (equal to --export-filename) option:

inkscape -l -o test.svg test.eps
like image 155
ccprog Avatar answered Dec 11 '25 22:12

ccprog