Skip to content

Instantly share code, notes, and snippets.

@blizzz
Created October 26, 2016 16:28
Show Gist options
  • Save blizzz/d7d6d46e62a36741e1e976cc662eda25 to your computer and use it in GitHub Desktop.
Save blizzz/d7d6d46e62a36741e1e976cc662eda25 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
if [ $# -lt 2 ]; then
echo "merge single pdfs into one document"
echo "Usage"
echo "$0 Outputfile Inputfiles"
echo "Examples:"
echo "\"$0 fulldoc.pdf page1.pdf page2.pdf page3.pdf\""
echo "\"$0 fulldoc.pdf page*.pdf\""
echo "\nrequires ghostscript"
exit
fi
TARGET=$1
shift
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="$TARGET" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment