I\'m trying to use Image-Magick with PHP to convert SVG text into a PNG image. This SVG is a chart generated with NVD3 and I\'d like to allow my users to download it as an i
And remember that
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
must be the first line in a variable that contains SVG text. Knowing that may save you some headaches.
svg file text structure needs to be specified for readImageBlob
to decode the file.
Prepend <?xml version="1.0" encoding="UTF-8" standalone="no"?>
to your variable having svg text.
$svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'.$svg;
And you are good to go.