Skip to content

Instantly share code, notes, and snippets.

@kloneets
Created February 1, 2017 08:20
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 kloneets/bbd35138550f70c3968daf6874d72fea to your computer and use it in GitHub Desktop.
Save kloneets/bbd35138550f70c3968daf6874d72fea to your computer and use it in GitHub Desktop.
Merge multiple pdf files in one
#!/usr/local/bin/zsh
echo $0
echo $1
echo $*
if [[ -n "$2" ]]; then
echo "Merging files"
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$*
echo "Saving $1"
else
echo "Usage: pdfmerge merged_file.pdf first.pdf second.pdf [..] last.pdf"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment