html2canvas($('#head'), {
allowTaint: true,
onrendered: function (canvas) {
var base64image = canvas.toDataURL("image/png");
console.log(base64image);
}
});
答案 0 :(得分:0)
尝试一下!
html2canvas($('#head'), {
onrendered: function(canvas) {
var base64image = canvas.toDataURL("image/png");
var tWindow = window.open("");
$(tWindow.document.body)
.html("<img id='Image' src=" + base64image + " style='width:100%;'></img>")
.ready(function() {
tWindow.focus();
tWindow.print();
});
}
});