📜  pdf表格文件下载反应不起作用 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:38.783000             🧑  作者: Mango

代码示例2
let input = document.getElementById("divToPrint"); 

html2canvas(input)
  .then((canvas) => {
    const imgData = canvas.toDataURL('image/png');
    const pdf = new jsPDF();
    pdf.addImage(imgData, 'PNG', 0, 0);
    pdf.save("download.pdf");  
  });
;