This script scans from the ADF (Automatic Document Feeder), preprocesses it and uploads it to Docspell.
-
A running Docspell instance.
-
Any Linux distro (tested on Ubuntu 20.04)
-
Install system requirements (apt command on Ubuntu:)
sudo apt install sane python3 python3-pip libmagickwand-dev img2pdf sane-utils
-
See if scanimage is able to find your scanner
scanimage -L
- if scanner is not found -> check
sane-find-scanner- Maybe also as sudo to see if it's an privileges problem
- If yes try
sudo adduser <username> lpand logout/login and restart scanner
- if scanner is not found -> check
-
Clone the repository
git clone https://github.com/eresturo/scanadf2docspell
-
Install requirements
cd scanadf2docpsell pip3 install -r requirements.txt -
Generate a API-Key, as described here
-
create a config file
custom.confapi_key: 'YOUR_API_KEY' docspell_url: 'http://YOUR_DOCSPELL_URL'
Unfortunately, scanimage arguments are partially dependent on the scanner. Therefore,
a customized configuration per
scanner may be necessary. For this purpose, you can specify with which command a
flatbed, with which a single-page adf
scan and with which a duplex adf scan can be triggered.
| tested Scanners | Config (custom.conf) |
|---|---|
| Epson XP 860 (default) | command_flatbed: '--source Flatbed'command_adf: '--source "Automatic Document Feeder" --adf-mode Simplex'command_duplex_adf: '--source "Automatic Document Feeder" --adf-mode Duplex' |
| HP 5590 | command_flatbed: '--source Flatbed'command_adf: '--source ADF'command_duplex_adf: '--source "ADF Duplex"' |
Note: This list is far from complete. Which scanner do you use and which configuration is needed? Please tell us in an issue or pull request.
-
insert a document in your scanner and run
./scan.py
-
See help for further options.
./scan.py --help
Suggestions, feature requests, ideas to improve the script? Feel free to open an issue or send a pull request :)