0

I am planning a web-page where images will be generated online. Now it's about to be decided whether I want to use SVG or images generated by an backend script. Download is an essential feature. Is there a way to download an html - svg generated object as a PNG/JPG/... ?

El Dude
  • 5,328
  • 11
  • 54
  • 101
  • 1
    There are ways to convert SVG to PNG using PHP and then you can use whatever technique you like for the download. See these posts RE conversion: http://stackoverflow.com/questions/10289686/rendering-an-svg-file-to-a-png-or-jpeg-in-php http://stackoverflow.com/questions/4809194/convert-svg-image-to-png-with-php – Jared Khan Apr 22 '14 at 20:16
  • thanks, that should be a good solution. however, there's no javascript class that could do it on the browserside? – El Dude Apr 22 '14 at 20:29
  • Yes actually, I hadn't thought of that. Not exactly a class but a simple way to do it would be render the svg to a canvas (visible or not) and export the canvas as a data URI. – Jared Khan Apr 22 '14 at 21:00

0 Answers0