OS X Command-line SVG To Jpeg/PDF

Hello everyone,

Paul Lefebvre shows us how to convert Office Documents on OS X.
Is there an analog function to convert SVG-Documents to JPEG or PDF without any external Frameworks then Apples owner?

Thanks you

There is some magic for that: http://www.imagemagick.org/script/convert.php

I know, but is ImageMagick built into OS X?

No. but can’t you embed the command line tool with your app?

No, but the users of my Software don’t know, how i do some conversions. So i need to be sure, that my functions are ready on every OS X.

I think qlmange can convert svg to png

type qlmanage --help in a terminal to see options

[quote=155857:@Axel Schneider]I think qlmange can convert svg to png

type qlmanage --help in a terminal to see options[/quote]
I read about it. It does not connect with the internet? Read something about “Server…blabla”

  • copy this to the Terminal Window

qlmanage -t -s 512 -o ~/Desktop/

  • drag a svg file to the Terminal Window

press Enter

[quote=155863:@Axel Schneider]- copy this to the Terminal Window

qlmanage -t -s 512 -o ~/Desktop/

  • drag a svg file to the Terminal Window

press Enter[/quote]

  • server Show quicklookd life information (statistics)

Do you get a preview of the SVG in the finder, or a generic file icon?

If you get a preview then you can use Quicklook APIs to read the image as a CGImage and then export them into what ever bitmap format you like. Check the MBS or MacOSLib for Quicklook functions.

In theory, again once you get the preview, you can open the image as a NSImage and then create a PDF context and draw it there if you want a vector PDF that is.