10

Can you please help me with a command to convert svg file to eps in ghostscript? I tried to open the svg file in Gimp but it is very big so it looks like gimp cannot open it or it take too long. I have two files which I want to convert.

Note: I have done a conversion from png to svg to convert raster to vectors and the convertion take most of my system disk space (almost 2GB). There for is it possible to use external cache drive for the command?

Charles
  • 50,943
  • 13
  • 104
  • 142
John Boe
  • 3,501
  • 10
  • 37
  • 71
  • 1
    If you don't have any luck with GS, try Inkscape - that will convert SVG to EPS on the command line. I've not tried EPS output but its PDF and PNG output is excellent. – halfer Mar 20 '12 at 23:03

1 Answers1

5

You'll need the 'sister' application to Ghostscript, called GhostPDL. GhostPDL includes an executable named gsvg (or gsvg.exe on Windows) which can consume SVG input and output PostScript, PDF, PNG, TIFF, PPM, PBM, JPEG and some more.

You probably need to compile GhostPDL from source. Then run 2 commands:

gsvg \
  -dNOPAUSE \
  -sDEVICE=ps2write \
  -sOutputFile=my.ps \
   my.svg 

gsvg apparently doesn't support direct EPS writing. So next, run:

gs \
  -dNOPAUSE \
  -sDEVICE=epswrite \
  -sOutputFile=my.eps \
   my.ps 
Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
  • Thanks. I use windows. I found the ghostpdl and there are two executables: "gxps.exe handles files in the Microsoft XPS format; pcl6.exe handles files in the PCL/XL language family." What file should I use? I think if I would use gs so the gs does not know where to find the program ghostpdl . They say "These GhostPDL builds are command-line tools. You'll need to invoke them from an MS-DOS prompt. For example: gxps-871.exe tiger.xps or pcl6-871.exe frs96.pxl " – John Boe Mar 20 '12 at 21:34
  • Should I have gsvg in the ghostpdl? I don't. Where to got it? Is any version for Windows/CMD? – John Boe Mar 20 '12 at 22:22
  • I have found a way how to convert png to eps directly in autotrace, so I have my need done. Thanks – John Boe Mar 20 '12 at 23:12
  • @user1141649: as I said -- *"you probably need to compile GhostPDL from source"*. On Windows, instead of `gs` use `gswin32c.exe` or `gswin64c.exe` – Kurt Pfeifle Mar 21 '12 at 06:51
  • 4
    gsvg has been removed from ghostpdl. You'll only find gsvg in the old sources in the SVN. See http://stackoverflow.com/questions/33257452/convert-svg-to-pdf-with-ghostscript-ghostpdl – Stefan Steiger Oct 22 '15 at 12:37