In Switzerland, it appears to be common to pay bills via payment stubs called "Einzahlungsscheine". When paying bills online, it is necessary to enter some of the information from the stub into the online bill-payment form. This is particularly tedious for the orange-colored version of the payment stub, since it has a 27-digit reference number that needs to be typed in by hand.

There are stub-reader scanner-pens available (e.g., "PayPen") to simplify this task, but as far as I know, they don't support Linux. Furthermore, the readers are not cheap (SFr. 150 or more). Considering that a fair number of people already own a scanner (e.g., through an All-in-One device), it seems silly to have to pay that much and have to deal with yet another device on your desk, when you already have a perfectly good scanner.

To alleviate these problems, we created a Firefox-extension which will automatically scan a payment stub, read the reference-number, payment-amount, and the account-numbers off the stub, and then enter the information in the appropriate places on the online bill-payment form.

EZLeser is free and distributed under GNU GPL v3.


Once installed (see "Installation" for details), typical usage is as follows:
  1. Log onto your online bill payment system.
  2. When you're ready to make a payment, put the Einzahlungsschein in the scanner (orientation doesn't matter), then right-click inside the browser-window and call up "Einzahlungsschein Lesen".
  3. The browser's status-bar should now show "EZ Leser: Am Dokument Lesen".
  4. A few seconds after the scanner finishes scanning the Einzahlungsschein, the browser's status-bar should display "EZ Leser: 6 Werte gefunden".
  5. The payment form should now have the payment account-number, the amount, and the reference-number prefilled with the values read from the Einzahlungsschein.
That's it!


If reading a payment stub fails with the message "EZ Leser: Keine Felder gefunden" you could try to reorient the stub in the scanner. Reading the stub may work better if its aligned with the edge of the scan-surface. Specifically, it may work best if the long side of the stub is aligned with the short side of the scanner. In any case, if reading of a stub fails, I'd appreciate it if you could send me a copy of the scanned image (assuming you're comfortable sharing the image of the payment stub with me). This is most easily done with the following script:

file="test-$(date +%y%m%d-%H%M%S)"
/usr/bin/scanimage --mode color --resolution 300 > /tmp/$ppm
ppm2tiff -c lzw /tmp/$ppm /tmp/$tiff
/usr/bin/mime-construct --to \
        --subject "Test image $tiff" \
        --file-attach /tmp/$tiff
/bin/rm -f /tmp/$tiff /tmp/$ppm
exit 0
You can download this script
here. With this script installed, simply execute "do-scan" and the image will be scanned and emailed to me.

If reading the payment stub works, but you don't get the form filled in automatically, you may need to edit the map file and adjust it for your payment-site. See "Installation" for details.




The EZLeser sources are distributed under GNU GPL v3. The source code for ezleser, ppmautorot, and extract_fields are available here:
The JavaScript code used by EZLeser is included in the Firefox extension file (.xpi). Just unzip that file to get at its contents.

The Tesseract OCR reader is distributed by Google Code. To get Tesseract to reliably recognize numbers in the OCR font used on the payment stubs, I used this training file:

This file, in turn, was created with OpenOffice, using the freely available OCRB10 TrueType font available here.


EZLeser uses Tesseract as its OCR engine.

Copyright © 2008-2009 Mosberger Consulting LLC