Command line scanning
But if you plan to scan more than one page you need to save each one and you have to provide a name for them. That means some mouse clicks and some typing at the keyboard. I was wondering if it was a better way, something like an automated script. I learned that there is a command line tool in the scan-tools package called scanimage that does just that: It allows you to launch a scan from a script. So what I did was to create a simple for loop and I used the loop variable to increase the page count. Each iteration was scanning a new page and converting it to a JPEG file with a sequential name.
After a power problem with the scanner I learned that next reconnection used a different device name, so I included that onto my script to avoid having to change it all the time. This is the final result:
if [ -z "$1" ]; then
echo "usage: scan.auto init_page end_page"
DEV=`scanimage -L|grep snapscan|cut -d " " -f 2|sed "s/\x60//"|sed "s/'//"`
for((i=$1;i<=$2;i++)) ; do
scanimage -d $DEV -p --mode=gray --resolution=150> page.pnm
convert page.pnm p`printf "%03d" $i`.jpg
echo "Scanned page #" `printf "%03d" $i`
printf "press enter for next page\n"