I have a problem that this (simplified) code seems not to close the created c.pdf. If I try to open the pdf while the server/nodejs is running, I get a an error with Foxit Reader: Encountered a sharing violation while accessing. As soon as I close the node.js, the problem is gone.
node v8.7.0 / windows 10
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
var hummus = require('hummus');
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World!\n');
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
let inStream1 = new hummus.PDFRStreamForFile('a.pdf');
let inStream2 = new hummus.PDFRStreamForFile('b.pdf');
let outStream = new hummus.PDFWStreamForFile("c.pdf");
let pdfWriter = hummus.createWriterToModify(inStream1, outStream);
pdfWriter.appendPDFPagesFromPDF(inStream2);
pdfWriter.end();
I have a problem that this (simplified) code seems not to close the created c.pdf. If I try to open the pdf while the server/nodejs is running, I get a an error with Foxit Reader: Encountered a sharing violation while accessing. As soon as I close the node.js, the problem is gone. node v8.7.0 / windows 10