【问题标题】:Getting custom text wrapped in auto table jsPDF获取包装在自动表jsPDF中的自定义文本
【发布时间】:2018-07-26 10:09:00
【问题描述】:

我有一个要求,其中需要使用 jsPDF 在 PDF 上生成表格/自动表格。

我可以使用以下链接生成表格并下载 PDF: https://github.com/simonbengtsson/jsPDF-AutoTable

但是,生成的表格需要与所附屏幕截图类似。

我该如何继续?

【问题讨论】:

    标签: javascript jspdf jspdf-autotable


    【解决方案1】:

    您可以通过以下方式进行。

    不推荐使用此 autoTableEndPosY

    pdf.autoTable({
     //....
    });
    
    let y = pdf.autoTableEndPosY();
    pdf.text(x, y+10,'This is Text');
    //add 10 (or any number of choice) to y for adding space between table and text
    

    请从现在开始使用以下代码

    pdf.autoTable({
         //....
    });
    
    let y = pdf.autoTable.previous.finalY;
    pdf.text(x, y+10,'This is Text');
    //add 10 (or any number of choice) to y for adding space between table and text
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-24
      • 1970-01-01
      相关资源
      最近更新 更多