by Frederik Granna
I’ve always been frustated with the complicated process required to scan a document: You need to get the scanner from the shelf, install the right software and hope that the hardware gets recognized when you plug the USB cable, start the scanning process, click through alerts and so on. Not to mention that with tablets and smartphones it’s usually not even possible to connect an external device. I‘ve been looking for a solution to all of these problems in one always-online device. I wanted the possibility to archive all incoming postal mail as searchable PDFs direct to my doctape account and without the need of using my laptop. Fortunately, I had an unused Rasperry Pi at home which I decided to use for this purpose.
Today, I created an interesting DIY solution for uploading documents to a cloud service without spending much time or money doing so!
I did some research and stumpled upon the great the solution from Eduardo Luís: http://eduardoluis.com/raspberry-pi-and-usb-network-scanner/. Eduardos solution scans tiff files to email – emulating a basic function of modern desktop scanners in a device with only a single button.
After planing a bit I realized that a single button was a little to restricted for my case: I wanted a little more comfort – A button to cancel the scan process and to add more pages to a document made more sense for me. What was still missing was a bit of feedback, so I decided to use a display. After minutes of research I found out, that Adafruit’s Addon Shield Display with its two-line LCD Display and five small input buttons was a perfect match.
The scanning process is carried out by the Software “SANE” (http://www.sane-project.org/). Then “tiff2pdf” converts the raw image into a PDF. Initially I planed for the OCR process to be handled by the well known open source OCR engine “tesseract”- The problem: The Raspberry took too much time doing the OCR part (at least 1-2 minutes per page). For this reason I started looking for an OCR alternative. Finally I found the Abbyy Cloud OCR SDK (http://ocrsdk.com/). A great SaaS solution to convert existing PDFs into searchable ones (http://ocrsdk.com/plans-pricing/).
An important requirement I had, was to make the device usable for multiple users. The best way to achieve this without additional hardware parts, was to use QR-Codes. The QR-Code should be scanned in order to identify the user to whose doctape account the pdf’s shall be sent to.
The display control and the button query is managed by i2c. Specifically for this project, I cloned a small NodeJS-Module, (https://github.com/korevec/node-i2c) and made it match my case.
Picture: Communication with the LCD in nodejs
The scanning Process:
To start scan the QR Code, which includes your doctape user name.
(There are many possibilities to make this part better, for example by doing user identification over RFID)
Scanning of 1-N Pages
(1) unify single scans (pages)
(2) convert to PDF
(3) send the PDF to Abbyy for text recognition
· Raspberry Pi (version B)
· Adafruit Blue&White 16×2 LCD+Keypad Kit for Raspberry Pi
· Canon CanoScan Lide 110* (works with other scanners too. Photo proof attached)
· zbarimg for QR-Code Recognition
· ABBYY Cloud OCR SDK