11 log
"Convert all pdf pages to a montage"
12 log
"Usage: $0 INPUT.pdf OUTPUT.png"
15 log
"Processing $1 to $2"
18 trap "rm -r $TMPDIR" EXIT
19 log
"Temp directory created in $TMPDIR"
21 NUMPAGES
=$
(identify
"$1" |
wc -l)
22 log
"$NUMPAGES detected"
24 log
-n "Processing page: "
25 for ((p
=0;p
<$NUMPAGES;p
++))
27 convert
"$1"[$p] -resize $PAGERESIZE $TMPDIR/$p.png
32 montage
-geometry +0+0 $TMPDIR/*.png
"$2"