views:

216

answers:

3
+2  Q: 

SVG to JPG / PNG

Hi,

is there any working module to convert a SVG image into a pixel format like JPEG or PNG?

Thx Jan

+3  A: 

Take a look at the Batik toolkit. Specifically the rasterizer:

http://xmlgraphics.apache.org/batik/tools/rasterizer.html

slebetman
+1  A: 

If you have imagemagick installed (the tool, not sure how it would work with the PHP package), it can be as simple as:

<?php
  `convert infile.svg outfile.jpg`
?>
Wrikken
+2  A: 

Hi,

If you're using PEAR you can the XML_svg2image package (http://pear.php.net/package/XML_svg2image/). If not you should take a look at ImageMagick command line tool (http://www.imagemagick.org/script/command-line-tools.php). The convert program is quite simple to use : http://www.imagemagick.org/script/convert.php#usage

Kaaviar