javascript - Download Svg as png doesnt work on IE11 -


the svg d3 graph needs downloaded.i have used savesvgaspngjpgsvg initiate download .the code works fine on other browsers expect ie11. fiddle

i have tried :

svgasdatauri(svg, {}, function(svg_uri) {  		render_width=1000;  		render_height=1000;  		 var canvas = document.createelement('canvas');   			 canvas.height = render_height;    		     canvas.width = render_width;   			 document.body.appendchild(canvas);      // create image , draw svg onto canvas   		 var image = new image;   			 image.onload = function() {    			  canvas.getcontext('2d').drawimage(this, 0, 0, render_width, render_height);   			 };    image.src = svg_uri;    settimeout(function(){//download_in_ie(canvas, 'filename' + '.png');     	if (canvas.mstoblob) { //for ie                  var blob = canvas.mstoblob();                  window.navigator.mssaveblob(blob, 'dicomimage.png');              }  }, 3000);          			});

using mssaveblob suggested in given link results securityerror

how can achieve this?


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -