Posts tagged scanner
Scanning via USB from a Brother MFC-8500C
Oct 29th
I’m still working on digitizing all my old media, including paper. I have an old Brother laser multi-function with an automatic document feeder that I’ve only ever used as a printer and fax. I tried to set it up for scanning years ago, but had no success. Times have changed and I had no problem getting it working this time around so I can scan all my old paper files.
Scanning only works for the root user at the moment, but I don’t care. Discussion here.
Step 1. Download and install the linux drivers which are now available from Brother here. The instructions provided worked flawlessly on Ubuntu Jaunty.
Step 2. As root, Install the sane-utils and libtiff-tools packages.
Step 3. Scan. XSane worked fine for basic scans, but I want to be able to do double-sided scanning on a simplex scanner, so I decided to use the command line for this. There are other tools available if you prefer a gui.
To scan letter-size single sided:
The “-y 279″ is the page length in mm — without it, scanimage seemed to create legal size scans by default. To scan a pile of pages on both sides, start with side one:
Then, flip over the pile and substitute the last page number (which the previous command will tell you) minus one for “[last page - 1]” below:
Finally, put the whole thing together in one big tiff and convert to pdf:
The final rm is added to the previous command so that you can continue scanning jobs without either getting your tiff files mixed up or inadvertently trying to include a finished multipage tiff in the next pdf conversion.
I have written a script which prompts the user for single or double-sided printing and an output filename, then scans and converts documents:
#kk a script to scan a batch of pages on both sides, then combine and convert them to pdf
WORKDIR=”/tmp”
OUTPUTDIR=”/home/kevin/Dropbox/tmp/scans”
DATESTAMP=$(date ‘+%Y%m%d%H%M%S’)
#clean up
rm -f $WORKDIR/out*
#prompt for single or double-sided scanning
read -n 1 -p “How many sides ([1]/2)? ” SIDES
if [ "$SIDES" == "2" ]
then
#scan the first sides
#the end of this command sends progress output to both stdout and to a file
scanimage –format=tiff –batch=”$WORKDIR/out%d.tif” –progress –batch-double -y 279 3>&1 >&2 2>&3 3>&- | tee $WORKDIR/out_count.txt
#figure out what page to start the flip side scan on
LASTPAGE=`grep “Scanning page ” $WORKDIR/out_count.txt | tail -n 1 | sed ‘s/Scanning page //g’`
BATCHSTART=`echo $LASTPAGE – 1 | bc -l`
#give user a chance to flip and refeed the pages
read -n 1 -p “Flip over the pages (counting down from $BATCHSTART) and press any key to continue…”
#scan the second sides
scanimage –format=tiff –batch=”$WORKDIR/out%d.tif” –progress –batch-increment=-2 –batch-start $BATCHSTART -y 279
else
#scan the pages
scanimage –format=tiff –batch=”$WORKDIR/out%d.tif” –progress -y 279
fi
#combine all the tiff files into one document
tiffcp $WORKDIR/out*.tif $WORKDIR/out_all.tif
#prompt for a filename
read -p “What should I name the document (extension will be added automatically)? ” NAMER
if [ "$NAMER" == "" ]
then
NAMER=”scan$DATESTAMP”
fi
#convert to pdf
tiff2pdf $WORKDIR/out_all.tif -o $OUTPUTDIR/$NAMER.pdf
The script is pretty basic, but should be easily adaptable for your own purposes. You can save it as scan.sh, make it executable, and run it with “./scan.sh”