[英]open pdf after generate pdfkit/node webkit
I am working on a cross-platform App with Nw.js.我正在使用 Nw.js 开发跨平台应用程序。 I am trying to genrate PDF and to get it open but it dont work !
我正在尝试生成 PDF 并打开它,但它不起作用! and i have no errors !
我没有错误!
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();
Do you have any ideas ?你有什么想法 ?
Thanks谢谢
The file is automatically saved in a Temp folder.该文件会自动保存在 Temp 文件夹中。
just call:只需致电:
window.open('output.pdf');
And that's it就是这样
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.