wubzz / pdf-merge

Merge multiple PDF Files into a single PDF document
127 stars 32 forks source link

The PDFMerge never goes into the .then #32

Closed adame21 closed 5 years ago

adame21 commented 5 years ago

Hello, I've installed pdftk, and did npm install pdf-merge.

I tried a very basic merge where i have an array of absolute file paths and I attempt to get a buffer of the merged pdf.

I tried leaving it for defaults like leaving out the entire options object. I have made sure pdftk is installed and added to PATH system environment vars when I place breakpoints it seems to never go into the actual function and the .then OR the .catch

What am I missing here?

heres the code: PDFMerge(pdfNameArr, { output: "Buffer", libPath: 'C:/Program Files (x86)/PDFtk/bin' }) .then((testBuffer) => { avariable = testBuffer; console.log(testBuffer); }) .catch(err=>{ console.log(err) })

Let me know if there's anything else I should add for the question

EDIT: Just tried the different syntax and im getting a very unclear error Heres the code: try{ var mergedpdf = await PDFMerge(pdfNameArr) console.log(mergedpdf); } catch(err){ console.log(err) }

heres the error:

Huh... this is funny, i just ran it again to replicate the error to post here and its working... I wonder what heavenly force is responsible. Anyway, I will look into this a bit more and update.