Created
December 9, 2015 17:58
-
-
Save cypok/cc2fc5b25b68ac6a9e37 to your computer and use it in GitHub Desktop.
Simple script to place two PDF pages on single page with separator
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
if [[ -z "$1" ]]; then | |
echo No input file | |
exit | |
fi | |
input=$1 | |
middle=`mktemp -t pdf_2on1`.pdf | |
if [[ -z "$2" ]]; then | |
name="${input%.*}" | |
ext="${input##*.}" | |
output=${name}_2on1.$ext | |
else | |
output=$2 | |
fi | |
pdfnup --frame true "$input" "$input" --outfile "$middle" 2>/dev/null | |
pdfjam --landscape --trim '1mm 1mm 1mm 1mm' --clip true "$middle" --outfile "$output" 2>/dev/null | |
rm "$middle" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment