#!/bin/bash if [ $# -eq 0 ]; then echo "usage: scan file" fi DIR=$HOME/.tmp rm $DIR/*.tif.g4 export DIR cd $DIR if [ 1 ] ; then sudo modprobe usblp sudo modprobe uhci-hcd sudo mount -t usbdevfs none /proc/bus/usb >/dev/null 2>&1 sudo ptal-init start ptal-hp display fi fn=out`date +%H%M%S`.tif scanimage -v -d hpoj:mlc:usb:officejet_d_series --mode Lineart --compression None --format tiff --resolution 300 -x 210 -y 297 > $fn tiffcp -c g4 -r 100000 $fn $fn.g4 cd - ls $DIR/*.tif.g4 | xargs c42pdf -o $1.pdf