Fix hv-scan to configure pdf with US letter format
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 2 Sep 2013 20:35:12 +0000 (16:35 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Mon, 2 Sep 2013 20:35:12 +0000 (16:35 -0400)
scripts/hv-scan

index 6398599..d1b5628 100755 (executable)
@@ -7,6 +7,7 @@ color_mode="Gray"
 resolution="200"
 extension="pdf"
 scan_area="--scan-area Letter"
+resize_pdf="-page Letter"
 PROG_NAME=$(basename $0)
 
 print_usage()
@@ -33,6 +34,7 @@ while getopts "chjpq:r:" flag ;do
            ;;
        j)
            extension="jpg"
+           resize_pdf=""
            ;;
        h)
            print_usage
@@ -74,4 +76,5 @@ fi
 src=${1}
 
 scanimage --mode ${color_mode} --resolution ${resolution} ${scan_area} | \
-    convert - -compress jpeg -quality ${jpeg_quality} ${src}.${extension}
+    convert - -compress jpeg -quality ${jpeg_quality} ${resize_pdf} \
+    ${src}.${extension}