Skip to content

Instantly share code, notes, and snippets.

@afterdesign
Last active December 13, 2015 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afterdesign/4979646 to your computer and use it in GitHub Desktop.
Save afterdesign/4979646 to your computer and use it in GitHub Desktop.
Brother scan to tiff and create pdf.
#! /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