0

I have javascript code : var win = ("data:image/svg xml;base64," Utils.encode64(svg)); in HTML5. I want convert it into data:image/png;base64,.....

I tried with win= win.replace('data:image/png;base64,',''); But replaces the xml to png, but the it does not display the image correctly and giving an error message.

plz help to out..

  • 1
    As far as I am aware, this is not possible. PNG is not a vector format, nor is it a XML format, it is not compatible with SVG in any way. – Geoffrey Aug 09 '12 at 07:26
  • In most browsers if add the SVG image to a `canvas` it will get converted to a bitmap automatically. – robertc Aug 09 '12 at 07:47
  • there is way to export svg into png.. check it.http://svg-edit.googlecode.com/.....i dcant find exact way of conversion – user1065147 Aug 28 '12 at 06:51

0 Answers0