#!/bin/bash
# 1. Split the PDF into odd and even page files:
pdftk $1 cat odd output odd-$1 && pdftk $1 cat even output even-$1

# 2. Adjust margins for odd and even pages:
./pdfcrop1 -t '50 50 0 100' odd-$1 new-odd-$1
#              ^^
./pdfcrop1 -t '0 50 50 100'  even-$1 new-even-$1
#                   ^^
# 100 is fairly centered, 60 pushes the text closer to the outside...  40 may be too far.

# 3. Merge the pages back together:
pdftk O=new-odd-$1 E=new-even-$1 shuffle O E output new-$1

pdfjam --outfile a5-$1 --paper A5 --scale 0.9 new-$1
pdf2up --a4 a5-$1 
mv print-a5-$1 print-$1
#rm -f a5-$1 clipped-$1 new-$1 new-odd-$1 new-even-$1
