I have tried to export the svg element to canvas element and that was working finr in chrome and firefox but that was not working in IE. can you please guide me what i made wrong or how to solve this?
Here is my code,
$("#import").click(function(){
var canvas = document.getElementById('canvas1');
var ctx = canvas.getContext('2d');
var DOMURL = window.URL || window.webkitURL || window;
$("#containerew").attr("xmlns", "http://www.w3.org/2000/svg");
var data1 = document.getElementById("containerew").outerHTML;
var img = new Image();
var svg = new Blob([data1], { type: 'image/svg+xml;charset=utf-8' });
var url = DOMURL.createObjectURL(svg);
img.onload = function () {
ctx.drawImage(img,25, 25);
DOMURL.revokeObjectURL(url);
}
img.src = url;
return true;
});
Please find the below link for example