4

I am working on converting svg to png. For this conversion I am using canvg. This conversion is working fine for normal svg with svg elements like rect and circle, But it doesn't work for svg which contain image element.I searched a lot but i didn't found any solution.

Here is the DEMO, which i have tried with image element.

I don't know what is happening wrong here. How to use canvg for svg image elements.
Any suggestions should be appreciated.

NOTE : Here is the working demo with svg circle

Karthi Keyan
  • 4,243
  • 5
  • 24
  • 47
  • You'd have to encode the image data as a data URI. Privacy restrictions in browsers mean that what you give to drawImage must be complete in a single file. – Robert Longson Nov 15 '13 at 14:33
  • Hi karthik, did you manage to get this to work? I hav tried @RobertLongson suggestion without success. canvg returns a blank image every time I include an image in the SVG xml. Thanks! – JuanXarg Feb 14 '14 at 21:16

0 Answers0