wubzz / pdf-merge

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

Wildcard treated literally for paths in quotes by pdftk-java #38

Open jackfiszr opened 4 years ago

jackfiszr commented 4 years ago

Due to some deprecation issues, a port of the original pdftk – pdftk-java – is now the standard pdftk for Debian. Unfortunately when using a wildcard and at the same time enclosing the file path in quotes, pdftk-java tries to open a file that actually contains ‘*’ in it’s name and of course is not able to find it. A simple fix would be to change shellescape([file.replace(/\\/g, '/')]) to [file.replace(/\\/g, '/').replace(/ /g, '\\ ')] and escape spaces instead of adding quotes.

Arguably this could also be reported as an issue to https://gitlab.com/pdftk-java/pdftk/issues