Closed overflowz closed 7 years ago
Hi, I'm trying to append pdf pages from another pdf (appendPDFPagesFromPDF).
I'm using following code (basic):
const hummus = require('hummus'); async function appendPages() { // can also return new Promise(). const pdfWriter = hummus.createWriter('test.pdf'); pdfWriter.appendPDFPagesFromPDF('append.pdf', { type: hummus.eRangeTypeSpecific, specificRanges: [[0, 0], [3, 3]] }); pdfWriter.end(); return true; }; appendPages().then(() => { console.log('success') }).catch((err) => { console.error(err) });
When I saw the source, seems .end() is asynchronous.
So, how can I know that it ended up successfully or it had an error while doing it? Isn't there any callbacks to check? Also, do I have to cleanup it as well? If so, how to?
all hummus methods are sync. so no need to worry about that.
oh, thanks!
Hi, I'm trying to append pdf pages from another pdf (appendPDFPagesFromPDF).
I'm using following code (basic):
When I saw the source, seems .end() is asynchronous.
So, how can I know that it ended up successfully or it had an error while doing it? Isn't there any callbacks to check? Also, do I have to cleanup it as well? If so, how to?