Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren, 7 Monaten
Letzter Beitrag:
vor 2 Jahren, 7 Monaten
Beteiligte Autoren:
Arie, DarrenF, CCC2, Stewart Crisler, heinz kübler, Fabrice Harari, Stefan Bentvelsen

Barcode recognition

Startbeitrag von Arie am 12.11.2015 20:48

for one of my customers I made a scanning application using the standard twain interface.
Now they want barcode recognition, to read an ordernumber from the scans.

What option can you guys give me for that?


Hi Arie,

is it for WinDev or WinDev Mobile ?

von Stefan Bentvelsen - am 12.11.2015 21:47
Hi arie,

are you talking about barcode scanner or normal document scanner ?


von CCC2 - am 12.11.2015 23:08
Hey Arie,

What version of WX?

There's a new twain property in WD and possibly WB server - http://doc.windev.com/en-US/?3078006&name=Twain_constants


Now I suppose how well this works probably depends on your scanner and it's drivers?

von DarrenF - am 13.11.2015 00:02
Sorry, for not giving enough details,

it a WD19 project using an sql-server database.
Upgrade to WD20 is an option.

The application stores A4 transport documents in a blob file. Some of them have a barcode with the ordernumber. I would like to "read" this number and attach the document to the right order in the database.
Document are scanned using high-speed scanner which easily scans 30+ pages per minute. After scanning a batch the user attaches the documents to orders now, entering additional info (written by hand on the papers) here and there.

The recognition of the barcode does not necessarily take place during scanning. It may also come afterwards, when the user checks every scanned page.

von Arie - am 13.11.2015 08:03

interesting, it seems to be a twain option then, whereas the scannerdriver must support this.
I dont see any function however on how to read this barcode-info.
I will digg into it further

von Arie - am 13.11.2015 08:11
Yeah, that's why I thought it must be embedded in the drivers or the scanners software. You may be lucky as it sounds like you're using a high end scanner :xcool:

Although not cheap, there are a few SDk's out there for this kind of thing; e.g. https://www.leadtools.com/sdk/twain

von DarrenF - am 13.11.2015 08:30
Yes, saw that too.
Atm we are using Kofax stuff. Same pricing model :rolleyes:
Afaik the reason for that is, that these driver do the barcode recognision WHILE scanning. After each scan the barcode(s) are available immediately.

There are also a number of SDK's which do image-recognisition, I mean afterwards like https://www.dynamsoft.com
Maybe that will do for me.

von Arie - am 13.11.2015 09:11
Yes, it sounds from your requirement that the barcode needs to be linked at different points in the lifecycle, but if your scanner provides the functionality in it's drivers and WD20 can turn the feature on then it's a cheaper option. If the docs need to be re-scanned, can already scanned docs be passed thru the TWAIN driver again by programming? ...sorry don't know enough about TWAIN

von DarrenF - am 13.11.2015 09:47
Hi Arie

you can use the free ZXING dll/module (supported by google, used to recognize barcodes on android, etc)

Best regards

von Fabrice Harari - am 13.11.2015 14:35
Hi Arie,

I did some similiar scanning applications with kofax (no windev) years ago, and if i remember correctly, the kofax software could be configured to deliver a textfile per scanned batch with the barcodes resolved as a number - together with the filename of the document and more details - and the main app had no need to "read" the scanned image (pdf or tif)

hope that helps

regards : heinz

von heinz kübler - am 13.11.2015 18:36
Thanks Heinz,
interesting - I will check that out soon

von Arie - am 13.11.2015 19:06
Just to let you know what is possible in WinDev, I am looking through a scanned document, finding a code 39 bar code and decoding it. It takes 1 to 2 seconds per document which I thought was pretty good and very acceptable for the volume of work I'm processing. This is all done using purely WinDev code.

Some things I learned.

(1) A jpg is inadequate. You need a 300 dpi bmp (or higher resolution).
(2) WinDev has a wonderful command that will convert an image into an array of bits. After that FOR EACH is your friend.
(3) It definitely helps if you know where to look on the image for the bar code. I look in a couple of known spots and then attempt a whole document search.

In my case the bar code was code 39 and I only needed to decode the digits which limited the pattern recognition that I had to build. When I got a number I could verify it by doing a table lookup. My bar coded number includes a check digitt so if I got a hit in my table, I was very confident I had a good decode. Finally I have a number of years of experience with bar code technology so that was a definite leg up in terms of doing the programming.

A TWAIN driver or external DLL would also get the job done. Just make sure you are using a high resolution setting. Kudos to WinDev for what it can do natively.

Stewart Crisler

von Stewart Crisler - am 14.11.2015 00:46
use this .net api . import the dll into wd project

M_strs is array of strings = BarcodeScanner.Scan("barcode.png")
M_str is string

FOR EACH M_str OF M_strs


make sure to cut out the barcode first

dSaveImagePNG(dCrop (dLoadImage("invoice.png"),795,210,224,110),"barcode.png")

hope will help

von CCC2 - am 14.11.2015 03:02
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.