It baffles me that html2canvas is failing to capture the full height of the div.
html2canvas($container, {
height: $container.height(),
onrendered: function(canvas) {
var data = canvas.toDataURL('image/png');
var file = dataURLtoBlob(data);
var formObjects = new FormData();
formObjects.append('file', file);
$.ajax({
url: 'ajax_preview',
type: 'POST',
data: formObjects,
processData: false,
contentType: false,
}).done(function(response){
console.log(response);
//window.open(response, '_blank');
});
}
});
I've attempted adjusting the height manually with height: $container.height()
, but the image remains cropped. Setting the height to 1124 yielded the same result.
It's faint, but in the image below, there's a white section missing any content or borders. Everything within that area is excluded from the capture.
Any thoughts on what might be causing this issue?