2011-02-21

Converting PDF to SVG, that doesn't suck

There are a number of converters that take in Adobe Illustrator or Adobe PDF files, and emit SVG files. There are a number of online websites, a few simple little hacky Perl or Python scripts, and expensive commercial proprietary packages from people like Adobe.

They all suck, and emit crap gigantic SVG files.

Here is the way to do it that make perfectly covering SVG files that don't suck.


gs -dBATCH -dSAFER -dNOPAUSE \
-sDEVICE=svg \
-sOutputFile=Logo.svg Logo.pdf


If you have an Adobe Illustrator AI file instead of a PDF file, just put a PDF filename extension on the end, it will work fine.

3 comments:

  1. On Windows XP Pro SP3, using the gswin32c.exe command line interpreter, this spewed out a great number of messages in the command line window, printed a page with an XML header on it, and immediately began printing blank pages as fast as it could. I had to switch my printer off to get it to stop.

    Until somebody ports David Barton's pdf2svg to Windows, I'll stick with my current method: render everything in 300-DPI TIFF. Crude, but memory is cheap.

    If you have a better suggestion, please post it here; I'd be thrilled to read it.

    ReplyDelete
  2. Albert, source and solution to your problem is contained entirely inside the clause before the first comma in your comment.

    Do this on a Linux box. You probably have a VM manager like VMware or Virtual Box on your XP machine, so the "Linux Box" could just be a VM on your own machine.

    ReplyDelete
  3. Slightly less facetiously, did you try that command all in one line, or did you put the backslashes in? Backslashing to break lines is a UNIXism, that doesnt work on WIndows.

    ReplyDelete