x4nth055/pythoncode-tutorials

pdfmerge.py takes in only the first file (in the list of input files specified) as target for merging

ecsridhar opened this issue · 2 comments

python -i x1.pdf x2.pdf x3.pdf -o final.pdf
Considers only the first file x1.pdf as merge candidate and ignores the rest.

The current code is
input_files = [str(x) for x in args['input_files'][0].split(',')]
As a result even if args['input_files'] contains list of input_files, only first file is considered.

needs to be replaced with
input_files = args['input_files']

Hello @ecsridhar ,

It is expected to pass the PDF files separated in commas, not space:

$ python pdf_merger.py -i x1.pdf,x2.pdf,x3.pdf -o final.pdf

However, it's more convenient using your way, I will update it. Thanks!

It's updated now, you can use it like this:

$ python pdf_merger.py -i x1.pdf x2.pdf x3.pdf -o final.pdf

Thanks again.