-
-
Save jaredcrean/3e95b5027ab4b26b18e05f62164c1481 to your computer and use it in GitHub Desktop.
My Brother brscan scanner S-KEY tool scan to file script. Scan from ADF, convert to PDF and merge PDFs files into a single one.
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 | |
set +o noclobber | |
# | |
# $1 = scanner device | |
# $2 = friendly name | |
# | |
# | |
# 100,200,300,400,600 | |
# | |
resolution=200 | |
device=$1 | |
BASE=~/brscan | |
mkdir -p $BASE | |
if [ "`which usleep 2>/dev/null `" != '' ];then | |
usleep 10000 | |
else | |
sleep 0.01 | |
fi | |
output_tmp=$BASE/$(date +"%Y-%m-%d_%Hh%M") | |
echo "scan from $2($device)" | |
scanimage --device-name "$device" --resolution $resolution --batch="$output_tmp"_%04d.tiff --format=tiff -x 210 -y 297 | |
for tifffile in $(ls "$output_tmp"*) | |
do | |
tiffcp -c lzw "$tifffile" "$tifffile".lzw.tiff | |
tiff2pdf "$tifffile".lzw.tiff > "$tifffile".pdf | |
rm -f "$tifffile" | |
rm -f "$tifffile".lzw.tiff | |
done | |
pdftk $output_tmp*.pdf cat output "$output_tmp".pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment