wubzz / pdf-merge

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

Spaces in file path generate an error #4

Closed valeriod closed 8 years ago

valeriod commented 8 years ago

If there is a space in the source file such as /Users/valerio/Documents/Content Conversion/page1.pdf I get

Error: Unable to find file.
Error: Failed to open PDF file:  /Users/valerio/Documents/Content 

I think that file paths should be enclosed in double quotes when generating the command line.

wubzz commented 8 years ago

@valeriod Hi, under what environment did you encounter this? From the path it looks like Win, but running the following locally on Win I cannot reproduce:

var pdfMerge = new PdfMerge([__dirname + '/Folder With Space/File With Space.pdf'], __dirname + '/PDFtk/bin/pdftk.exe');
valeriod commented 8 years ago

Mac OS X El Capitan Version 10.11.4 but I believe that any *nix will do the same

wubzz commented 8 years ago

@valeriod Managed to reproduce this on debian, and fixed using shell-escape. Any non-Win should work now. (Win already worked as stated above)

I've published a new version.