I need to take a snapshot of a div. I used html2canvas and it worked okay. But when I add SVG into the same div it ignores the svg.
I also tried drawImage() which did not work either.
I read that clone() could do this but did not work.
<canvas id="myCanvas" width="250" height="300">Does not support HTML5 canvas.</canvas>
$("#Numbers").load("random/Nums.html");
drawImage():
var img = $("#Numbers");
$("#myCanvas").getContext("2d").drawImage(img, 0, 0, 125, 150);
clone():
$(myCanvas).html($(Numbers).clone());
html2canvas:
document.querySelector("#dbutton").addEventListener("click", function() {
var canvas = document.querySelector("#Numbers");
html2canvas(document.body, {onrendered: function(canvas) {
document.body.appendChild(canvas);
}
});
});
How do I capture a DIV which includes text, svg, images?
Appreciate your help.