Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Once upon a time I used Corel Draw to edit vector graphics. Now I'm looking at using Sketch. I previously converted all my old CDR files to PDF but Sketch doesn't seem to like to open PDFs containing vector graphics. Is there a free command-line program I can use to convert PDF to SVG?

share|improve this question
    
Are you sure that the conversion from CDR to PDF didn't destroy all vector information (by just rendering a bitmap into the PDF)? –  patrix Oct 5 '12 at 7:04
    
Yes. The PDFs are vectors. –  SSteve Oct 5 '12 at 14:56
add comment

2 Answers

ImageMagick has a command line tool called convert which does all sorts of things in addition to converting file formats. There are lots of options, but the simplest way would be to do

convert file.pdf file.svg

That might not give the best quality, so you may need some flags such as -density - check the man pages. ImageMagick can likely be installed through fink/macports/homebrew.

share|improve this answer
    
the convert is one hell of a great command. It's already present in OSX. –  Matthieu Riegler Oct 5 '12 at 17:39
4  
I did some tests with ImageMagick/convert and wasn't getting anything useful. So I did some looking around and found this page which says in bold letters: Avoid using ImageMagick for "Vector Image" to "Vector Image" conversions. Turns out it converts everything to raster format internally. So the hunt is still on… –  SSteve Oct 5 '12 at 18:17
    
Interesting find. I was unaware of the internal rasterization. –  cm2 Oct 5 '12 at 22:11
add comment
up vote 3 down vote accepted

Turns out Inkscape has a command line mode. I added this to .bash_profile:

alias inkscape="/Applications/Inkscape.app/Contents/Resources/bin/inkscape"

and now this command converts from PDF to SVG:

inkscape Logo.pdf --export-plain-svg=Logo.svg

Unfortunately, the current version of Sketch has very rudimentary SVG import capabilities and can't correctly read any of the files I've made even though they display fine in Opera and OmniWeb. The company says future versions will do better.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.