Skip to content

Instantly share code, notes, and snippets.

@gaviriar
Created February 11, 2018 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaviriar/9e54af43b89e1d80b8347cd2b126db6a to your computer and use it in GitHub Desktop.
Save gaviriar/9e54af43b89e1d80b8347cd2b126db6a to your computer and use it in GitHub Desktop.
merge PDF files in directory specified as input argument
if [ -z "$1" ]
then
echo "Usage: ./margepdf.sh <pdf-directory> <output-filename>"
exit 1
fi
# This section assumes you have the binary pdfunite in your path
# If not you can install them by:
# sudo apt-get install poppler-utils
files=( $1/*.pdf )
pdfunite "${files[@]}" $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment