Last active
December 13, 2015 21:48
-
-
Save afterdesign/4979646 to your computer and use it in GitHub Desktop.
Brother scan to tiff and create pdf.
This file contains 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=300 | |
device=$1 | |
mkdir -p ~/brscan | |
if [ "`which usleep 2>/dev/null `" != '' ];then | |
usleep 10000 | |
else | |
sleep 0.01 | |
fi | |
output_file=~/brscan/brscan_"`date +%Y-%m-%d-%H-%M-%S`" | |
output_file_tiff=$output_file".tiff" | |
output_file_pdf=$output_file".pdf" | |
#echo "scan from $2($device) to $output_file" | |
scanimage --device-name "$device" --resolution $resolution --format=tiff > $output_file_tiff 2>/dev/null | |
tiff2pdf -z $output_file_tiff > $output_file_pdf | |
rm $output_file_tiff | |
#echo $output_file is created. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment