Similar questions have been asked, and the REASON for the problem is well understood, what I'm asking for is alternatives or work-arounds:
What I'd like to do is get a data-URL out of a canvas that has an SVG document drawn onto it. I've tried all kinds of things, but IE9 and Chrome just won't let me have that URL as soon as SVG comes anywhere near that canvas.
I've tried:
- Canvg (doesn't support everything I need)
- Drawing the svg file directly to the canvas (content.drawImage(svg, 0 0))
- Creating a base64 string of the whole svg document, making it the source of an and then drawing that image onto the canvas.
- Saving the svg to a file, set an src attribute to point at the file (on the same domain), then draw that to the canvas
I'm running out of ideas.
Are there similar libraries I can try that will rasterize svg? Is there maybe something else I can convert SVG to before drawing so that the canvas never knows SVG was involved? Is there maybe a really simple way to do the conversion server-side with PHP or something similar?
do three things,
Hope this helps.