Here's the solution: scan2google
A small script on Ubuntu to upload multiple pages (one PDF) from your ADF scanner to your google documents account.
Tools needed:
scanadf
convert
pdfjoin
Source:
- #!/bin/bash
- # Configuration:
- # Obtain device name from scanadf -L
- devname=pixma:04A91712_10FA81
- guser=yourgoogleuser
- gpass=yourgooglepassword
- set -x
- cd /tmp
- mkdir scanadf
- chmod 770 scanadf
- cd scanadf
- rm -Rf *
- googfile="$(date +%Y%m%d-%Hh%Mm%Ss)-scanned.pdf"
- # Parameters below are for grayscale lettersize paper at 150dpi
- resolution=150
- scanmode=gray
- ###################################################
- #echo Start page number?
- #read startp
- #echo Nbr of pages
- #read nbrp
- echo "Scanning pages..."
- if [ "$1" == "--noadf" ]
- then
- scanadf -d $devname -o p%d.pbm --mode $scanmode --resolution $resolution -e 1
- else
- scanadf -d $devname -o p%d.pbm --mode $scanmode --resolution $resolution --source "Automatic Document Feeder"
- fi
- echo "Converting bitmapped images to PDF..."
- rm -f *.pdf
- for i in $(ls -rt *pbm)
- do
- convert -compress jpeg $i $(basename $i.pdf)
- rm -f $i
- done
- echo "Merging PDF file..."
- pdfjoin --outfile $googfile $(ls -rt *.pdf)
- rm -f *.pbm.*
- echo "Uploading to google docs"
- java -jar /usr/local/bin/google-docs-upload-1.2.jar "$1" --without-folders --username $guser --password $gpass "$(pwd)"
UPDATE 25/4/2012:
Since 2011, the google docs upload was broken, now i found another nice way to fix this:
1) Install cloudprint explained by this post:
http://www.niftiestsoftware.com/cups-cloud-print/
2) Replace line 45 by this one:
cat $googfile | lpr -P $PRINTER -T"$(date +%Y%m%d-%Hh%Mm%Ss)-$(zenity --entry --text="Document keywords").pdf"
I've included a zenity dialog to include some meaningful text describing the document