I have a SVG image on this path http://www.quickdesign.com/user-uploads ... -saved.svg
Which i need to convert into PNG for which i am using below code on this php file http://www.quickdesign.com/png.php
Code: Select all
<?php
$svg_file_name = 'user-uploads/5555f546857ce-saved.svg';
$png_file_name = 'png/converted.png';
$im = new Imagick();
$im->setBackgroundColor(new ImagickPixel('transparent'));
$svg = file_get_contents($svg_file_name);
$svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'.$svg;
$im->readImageBlob($svg);
/*png settings*/
$im->setImageFormat("png32");
$im->writeImage($png_file_name);
header('Content-type: image/png');
echo $im;
$im->clear();
$im->destroy();
?>
Can anyone please help me how to convert this svg image http://www.quickdesign.com/user-uploads ... -saved.svg to PNG image using PHP.
Any help would be appreciated.
Thanks