jjwilly16 / node-pdftk

A wrapper for PDF Toolkit with streams and promises.
MIT License
141 stars 34 forks source link

using array input cat command fails for empty arguments #1

Closed thomasoberthanner closed 7 years ago

thomasoberthanner commented 7 years ago

When using an array as input for cat command (no handles), these problems occur: no argument given for catCommand pdftk.input([a, b]).cat() throws error (split method called on undefined)

empty string as catCommand pdftk.input([a, b]).cat('') only first file "a" used, all others ignored.

pdftk.input([a, b]).cat(' ') only first file "a" used, all others ignored.

pdftk.input([a, b]).cat([]) works as expected

jjwilly16 commented 7 years ago

Sorry this took so long, I didn't receive my notification.

Just committed the fix and published to npm as well. Reinstall and you should be good to go.

I see someone else already ran into this problem here so I adopted his quick fix.