Created
October 14, 2016 11:33
-
-
Save dpavlin/6b52a7115178b7aa2c93f6cfaf8547b8 to your computer and use it in GitHub Desktop.
Scan pages using Sane's scanimage and convert them to pdf (with page and pdf preview using qiv and mupdf)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
nr=1 | |
mkdir $1 | |
while true ; do | |
file=$1/`printf "%04d" $nr`.jpg | |
echo "scanning page $nr -> $file" | |
scanimage --progress --resolution 300 --format jpg -l 0mm -t 0mm -x 210mm -y 297mm > $file | |
qiv $file | |
echo "enter = one more page, anything else to convert to $1.pdf" | |
read wait_for_key | |
if [ ! -z "$wait_for_key" ] ; then | |
convert $1/*.jpg $1.pdf | |
mupdf $1.pdf | |
ls -al $1.pdf | |
exit 0 | |
fi | |
nr=`expr $nr + 1` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment