Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple script to place two PDF pages on single page with separator
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