Created
March 19, 2025 20:12
-
-
Save sepastian/dc8dfebf740f4423c37f0fd097a70df9 to your computer and use it in GitHub Desktop.
Append PDF files one by one
This file contains hidden or 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
# Find PDFs, for example in sorted order, | |
# using https://gist.github.com/sepastian/5a39eb7aff7adcf2ba2460ca0738664a | |
find -type f -name '*pdf' | \ | |
while read f | |
do | |
# Append file 2 ... N | |
if [ -f all.pdf ]; then | |
~/go/bin/pdfcpu merge -m append all.pdf "${f}" | |
continue | |
fi | |
# Copy first file | |
cp "${f}" all.pdf | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment