【发布时间】:2018-07-26 10:09:00
【问题描述】:
我有一个要求,其中需要使用 jsPDF 在 PDF 上生成表格/自动表格。
我可以使用以下链接生成表格并下载 PDF: https://github.com/simonbengtsson/jsPDF-AutoTable
但是,生成的表格需要与所附屏幕截图类似。
我该如何继续?
【问题讨论】:
标签: javascript jspdf jspdf-autotable
我有一个要求,其中需要使用 jsPDF 在 PDF 上生成表格/自动表格。
我可以使用以下链接生成表格并下载 PDF: https://github.com/simonbengtsson/jsPDF-AutoTable
但是,生成的表格需要与所附屏幕截图类似。
我该如何继续?
【问题讨论】:
标签: javascript jspdf jspdf-autotable
您可以通过以下方式进行。
不推荐使用此 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
【讨论】: