![](/img/trans.png)
[英]Node Js NPM PDFkit and Voilab pdf table, pdfkit paragraph error afer generate table
[英]open pdf after generate pdfkit/node webkit
我正在使用 Nw.js 開發跨平台應用程序。 我正在嘗試生成 PDF 並打開它,但它不起作用! 我沒有錯誤!
var PDFDocument = require('pdfkit');
var fs = require('fs');
var appContent = document.getElementsByClassName('response');
doc = new PDFDocument;
doc.pipe(fs.createWriteStream('output.pdf'));
doc.fontSize(15);
doc.text(appContent[0].innerHTML);
doc.end();
你有什么想法 ?
謝謝
該文件會自動保存在 Temp 文件夾中。
只需致電:
window.open('output.pdf');
就是這樣
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.