How to covert svg to eps in ghostscript
Asked Answered
L

1

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?

Leahleahey answered 20/3, 2012 at 18:53 Comment(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.Briefless
F
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 
Further answered 20/3, 2012 at 19:21 Comment(5)
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 "Leahleahey
Should I have gsvg in the ghostpdl? I don't. Where to got it? Is any version for Windows/CMD?Leahleahey
I have found a way how to convert png to eps directly in autotrace, so I have my need done. ThanksLeahleahey
@user1141649: as I said -- "you probably need to compile GhostPDL from source". On Windows, instead of gs use gswin32c.exe or gswin64c.exeFurther
gsvg has been removed from ghostpdl. You'll only find gsvg in the old sources in the SVN. See #33257952Wellknown

© 2022 - 2024 — McMap. All rights reserved.