Я пытаюсь напечатать div с изображением внутри, используя html2canvas
.
function print_cert(){
var element = jQuery("#cert_viewer")[0];
html2canvas(element).then(function (canvas) {
console.log("ready");
var myImage = canvas.toDataURL("image/png");
var tWindow = window.open("");
$(tWindow.document.body).html("<img id='Image' src=" + myImage + " style='width:100%;'></img>").ready(function() {
tWindow.focus();
tWindow.print();
});
});
}
Когда я пытаюсь напечатать холст, изображение внутри него не включается в страницу печати
РЕДАКТИРОВАТЬ:
Div, который мне нужно напечатать:
<div id = "cert_viewer" class = "style_view" style="padding-top: 11px; margin-top: 36px;">
<p id = "matter1"></p>
<p id = "matter2"></p>
<img id="qrcode">
</div>