#!/bin/bash
sudo modprobe aha152x_cs
sudo modprobe sg
cd $HOME/.tmp
export filename=image-`date +'%s'`
#8939343 = 2549 * 3507
if [ $# -eq 1 ]; then
	export filename=$1
fi
#--emphasis High
sudo scanimage --format tiff --mode Lineart --resolution 300 -x 215.788 -y 302.00 --smoothing Off --speed "Extra Fast" > $HOME/.tmp/$filename
#sudo scanadf --raw  --mode Lineart --resolution 300 -x 215.788 -y 297.00 -e 1 --source Normal
for i in $HOME/.tmp/$filename ; do tiffcp -c g4 -r 100000 $i $i.tif.g4 ; done 
ls $HOME/.tmp/$filename.tif.g4 | xargs c42pdf -o $filename.pdf
