I am trying to grab the entire div container in one image using html2canvas. For some reason im only gets the part that appears on my screen. But I have horizontal scrolling on the div, so I would like to capture what was not on my screen, but the contents inside the div.
Is it possible? Right now my div is 5,000 pixels wide, can I somehow capture it in one image?
Here is my javascript code for html2canvas:
$(function() {
$("#btnSave").click(function() {
});
html2canvas($("#container_wrapper_anatomy"), {
onrendered: function(canvas) {
theCanvas = canvas;
var dataUrl = canvas.toDataURL();
window.open(dataUrl, "toDataURL() image", "width=100%, height=100%");
canvas.toBlob(function(blob) {
saveAs(blob, "container_wrapper_anatomy.jpg");
});
}
});
});
});
Thanks in advance.
source
share