Wednesday, February 8, 2023

Merge PDF files in a directory to one PDF file

This script merge files with spaces in the name and sorts them by name.

Enter in a directory with PDFs and execute:

 

ls -v *.pdf | bash -c 'IFS=$'"'"'\n'"'"' read -d "" -ra x;pdfunite "${x[@]}" output.pdf'
 

Source: Stackoverflow

No comments:

Post a Comment