html2canvas没有呈现完整的div

时间:2017-06-28 19:21:58

标签: angularjs html2canvas pdfmake

我正在使用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');
  }
});

};

0 个答案:

没有答案