Reputation: 1257
I am working on a cross-platform App with Nw.js. I am trying to genrate PDF and to get it open but it dont work ! 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
Upvotes: 1
Views: 1534
Reputation: 1257
The file is automatically saved in a Temp folder.
just call:
window.open('output.pdf');
And that's it
Upvotes: 1