- Get Input to Initiate Scan
- Scan Using Auto-Document Feed
- Post Processing
- Import to Evernote (via email)
Install Scanning Driver & Utilities
sudo apt-get install sane
You may need to adjust permissions for the scanners. I found as a non-root user I could not see any scanners when using:
I solved this by adding the current user to the “scanner” group:
usermod -a [current user] -G scanner
The SANE package installs two tools for scanning that we have seen above: scanadf and scanimage. As the Fujitsu Scansnap S1500 has an automatic document feed, the scanadf tool is better suited.
Install Image Processing Tools
I love Imagemagick. It has hugely powerful command line options for image and document processing. In this case we can use the “convert” command line tool to convert any scanned images into a PDF. It can be installed via:
sudo apt-get install imagemagick
Install Email Program (Mail User Agent – MUA)
A simple program called Mutt allows us to send an email with an attachment from the Linux command line. It can be installed using:
sudo apt-get install mutt
In my case I decided to create a new gmail account for scanning. I picked gmail as there were more online guides for these mail accounts.
After Mutt has been installed you need to configure it. I followed the guide here. In this case the important bit is setting up the SMTP configuration.
Writing a Script
Tying these programs together requires a little script:
#Feed documents and scan scanadf --source "ADF Duplex" --resolution 300dpi --y-resolution 300dpi #Store a date variable with time in hours and minutes - this is used as a file name DATE=`date +%d-%m-%y_%H-%M` #Convert any pnm images produced by the scan into a PDF with the date as a name convert image* $DATE.pdf #remove temporary pnm images rm --verbose image* #Send an email to your Evernote import address with the PDF attached - this is delivered to notebook "Inbox" with the tag "ToBeProcessed" mutt -s "$DATE - From Scanner @inbox #ToBeProcessed" [import address]@m.evernote.com -a $DATE.pdf -- < /dev/null
Additional features I am working on:
- Using scanbuttond to initiate script on button press – at present the program is not detecting the scanner (may be a permissions issue?).
- Process the scanned images using imagemagick – there may be an opportunity to remove blank pages by either looking at an intensity metric or comparing with a blank image.