【发布时间】:2022-08-12 04:46:59
【问题描述】:
当我执行 .text() 时,PDFKIT 会在 pdf 中显示这个给定的文本。代码如下: -
const doc = new PDFDocument();
// pipe the document to a blob
常量流 = doc.pipe(blobStream());
// add your content to the document here, as usual
doc.fontSize(25).text(文本, 100, 100);
// get a blob when you\'re done
doc.end();
但是,我想知道可以将 html 代码作为参数并在 pdf 上呈现该 html 代码的函数。或建议任何其他方法,但仅使用 PDFKIT 模块。
标签: pdfkit html-to-pdf node-pdfkit