HTML2Canvas 没有下载我的 pdf 文件

问题描述 投票:0回答:0
    window.onload = function () {
      document.getElementById("downloadButton")
      .addEventListener("click", () => {
        const invoice = this.document.getElementById("dashboardScreenid");
         
         var opt = {
                margin: 1,
                filename: docTitle,
                image: { type: 'jpeg', quality: 0.98 },
                html2canvas: {type:'view', scale: 1 },
                jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
            };
            html2pdf().from(invoice).set(opt).save();
           })
       }
   

Here is what I'm getting in console page

这是我的代码。我正在尝试从我的 HTML 网页中下载 pdf,其中包含一些内容,但无论如何都无法正常工作。如果这个类似的代码与一些 1 页的 HTML 网页一起工作,它就像一个魅力,但我正在尝试不下载。

html jspdf html2canvas html2pdf
© www.soinside.com 2019 - 2024. All rights reserved.