ok... another update...
to get this working, I have created a 'shim' for the scanimage executable in /usr/bin. So what I have done is renamed /usr/bin/scanimage to /usr/bin/scanimage_prog, I have then created a shell script that looks like this:
Code: Select all
scanimage_prog --format=tiff --buffermode=yes --stapledetect=yes --rollerdeskew=yes --source 'ADF Duplex' "$@"
from this shim I can insert the relevant settings manually to make the scanner do what I want (switched on deskewing, staple detection and buffering... this, for the most part, works.
The only problem that I have now, and the whole reason I bought a duplex scanner, is that I cannot get it to scan duplex... using the switch --source 'ADF Duplex' does switch on the duplex scanning, but it doesn't produce a multi-page document in Mayan-EDMS... I just get one side.
From the cli, I can get it to save both sides of the page using the following command:
Code: Select all
scanimage --batch=out%d.jpg --format=jpg -d canon_dr:libusb:001:002 --mode color --resolution 200
Scanning -1 pages, incrementing by 1, numbering from 1
Scanning page 1
Scanned page 1. (scanner status = 5)
Scanning page 2
Scanned page 2. (scanner status = 5)
Scanning page 3
scanimage_prog: sane_start: Document feeder out of documents
The end "error" is just that it has finished scanning... I then get multiple files called out1.jpg, out2.jpg out1 being first side and out2 being second side.
One thing to note with this, although this was a single sheet of paper, it scanned the entire sheet, then "scanned" the second sheet as it was in the scanners buffer without the sheet going through (2x scanning surfaces as the paper goes through they are both scanned at the same time. It seems that Mayan is not requesting the second page.
The problem is, as soon as you invoke the --batch command it changes the filenames... which then messes up how Mayan sees the documents to assemble.
Is there an environment variable that is set that I could read and insert into the shim for the batch filename process?? Just a thought...
This is still a work in progress at the moment... but if there is anyone that can shed any light on this, I would greatly appreciate it, as I really would like duplex scanning going properly.