Last active
June 28, 2019 13:34
-
-
Save udoyen/e706d5a675aaec5f75acd38b148114f9 to your computer and use it in GitHub Desktop.
How to merge pdf files using the pdfunite tool on linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e # Quit on first error | |
count=0 | |
for i in ./*/* | |
do | |
my_array["$count"]="$i" # Creates an array with the filenames | |
((++count)) # Increase the array index | |
echo ${my_array[@]} # Echo the contents of the array | |
done | |
# Carryout the merge | |
pdfunite ${my_array[@]} merged_output.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
|-- 01 | |
| `-- introduction-to-google-cloud-platform-slides.pdf | |
|-- 02 | |
| `-- getting-started-with-google-cloud-platform-slides.pdf | |
|-- 03 | |
| `-- virtual-machines-and-networks-in-the-cloud-slides.pdf | |
|-- 04 | |
| `-- storage-in-the-cloud-slides.pdf | |
|-- 05 | |
| `-- containers-in-the-cloud-slides.pdf | |
|-- 06 | |
| `-- applications-in-the-cloud-slides.pdf | |
|-- 07 | |
| `-- developing-deploying-and-monitoring-in-the-cloud-slides.pdf | |
|-- 08 | |
| `-- big-data-and-machine-learning-in-the-cloud-slides.pdf | |
|-- 09 | |
| `-- summary-and-review-slides.pdf | |
|-- merged_output.pdf | |
`-- merger.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment