Showing 1 changed files with 2 additions and 1 deletions
+2 -1
livret
... ...
@@ -12,6 +12,7 @@ size=$(pdfinfo "$pdf" | awk '/^Page size:/{
12 12
 	if (a >= 1189 && a <= 1191 && b >= 841  && b <= 843 ) print "a3"
13 13
 }')
14 14
 pages=$(pdfinfo "$pdf" | awk '/Pages:/{print $2}')
15
+size=${size:-a4}
15 16
 test $pages -ne 4 -o -z "$size" && exit	
16 17
 
17 18
 recto=$(mktemp -d /dev/shm/XXXXXXXX)
... ...
@@ -26,7 +27,7 @@ else
26 27
 fi
27 28
 
28 29
 booksize="a$((${size//[^45]}-1))"
29
-pdfjam --paper ${booksize}paper --nup 2x1 --landscape --outfile $recto "$output" 1 "$output" 4
30
+pdfjam --paper ${booksize}paper --nup 2x1 --landscape --outfile $recto "$output" 4 "$output" 1
30 31
 pdfjam --paper ${booksize}paper --nup 2x1 --landscape --outfile $verso "$output" 2 "$output" 3
31 32
 pdftk A=$(find $recto -name "*pdf") B=$(find $verso -name "*pdf") cat A B output "${pdf%/*}/livret-${pdf##*/}"
32 33
 rm -fr $recto $verso $output