Created
October 2, 2009 15:29
-
-
Save dentarg/199822 to your computer and use it in GitHub Desktop.
Mergs PDF files using GhostScript
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
#!/bin/sh | |
if [ $# -eq 0 ]; then | |
echo 1>&2 Usage: $0 output.pdf source.pdf [source2.pdf ...] | |
exit 127 | |
fi | |
for arg in $* | |
do | |
let "i += 1" | |
if [ $i -eq 1 ]; | |
then | |
output=$arg | |
else | |
pdfs="$pdfs $arg" | |
fi | |
done | |
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$output $pdfs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment