我正在使用html2canvas和pdfmake导出为pdf,我只能在当前窗口中看到屏幕,我无法获得完整的div并且div正在隐藏溢出。
var target = document.getElementById('centerRow');
target.className += ' html2canvasreset';
html2canvas(target, {
preload: function() {
target.className = angular
.getElementById('centerRow')
.removeClass('html2canvasreset');
},
onrendered: function(canvas) {
target.className += 'html2canvasBack';
var data = canvas.toDataURL('image/png');
var docDefinition = {pageSize: 'A1',content: [{image: data}]};
pdfMake.createPdf(docDefinition).download('export.pdf');
}
});
};