I'm creating a canvas based on svg using canvg and then through canvas I'm downloading an image.
Here is the code for creating an canvas taking svg.
//Creating the canvas
var myCanvas = document.createElement("CANVAS");
canvg(myCanvas, res[0],{ ignoreMouse: true, ignoreAnimation: true , ignoreClear: true });
//Downloading the image
var uri = canvas.toDataURL("image/jpeg");
var link = document.createElement("a");
link.download = name;
link.href = uri;
document.body.appendChild(link);
link.click();
The image obtained is partially with black background.Please help.