Home › Forums › TWAIN Classic › Question- how to extract barcode data from twain Application
- This topic has 34 replies, 25 voices, and was last updated 8 years, 10 months ago by eastken.
- AuthorPosts
i have downloaded Twain_SRC solution but i am unable to extract the barcode data from my image after it gets scanned Please help me:
my email id is: patil21vivek@gmail.com
Hi,
You can use ICAP_BARCODEDETECTIONENABLED, ICAP_SUPPORTEDBARCODETYPES and etc. to deal with the barcode information. Detailed information can be found in the TWAIN specification.
If you don’t want to learn all those capabilities, you can also find some third-party tool online, Dynamic .NET TWAIN (Barcode Add-on), to do the job for you.
Hello Patil,
You should make the following steps if you want to retrieve the extended image information:
- Check that the retrieving of the extended image information is supported by the device.
- Choose which information you want to retrieve.
- Retrieve the extended image information about acquired image right after the image is acquired.
VintaSoftTwain.NET SDK allows to extract an extended info about the image (barcode count, barcode type, barcode text, etc) very easily. You can see a code example in the “Programming – How to’s – How to get extended information about acquired image?” topic of the on-line documentation here:
http://www.vintasoft.com/docs/vstwain-dotnet/Best regards, Alexander
Thanks for your reply adam and vintasoft…!!
@Adam: I know that i have to use “ICAP_Barcodeenabled = true” or likewise capability mentioned in twain specification. But I am not getting where should i put my code in twain application. And if i want to edit the twain.lib file then i will have to write my own enum for barcode which is not provided in “TwainLib.cs” or “Twaindef.cs”. But in that case also I dont know which hex values are required to be set….please help… 🙁
Do you know that not all scanners can get information about barcodes on acquired page? Only professional scanners can get an extended image info.
Do you want to develop application for a professional scanner or for all scanners? You need use a barcode reading SDK if you want to develop application for all scanners.
Best regards, Alexander
Information about TWAIN constants can be get from TWAIN specification or TWAIN header file (twain.h).
Thanks Alexander for your reply…
Actually I am trying to develop an application in C# using Twain application. I am using EPSON plq 22 csm printer for it. When i use the “Sample Application” from twain – (which is in C++) it reads the barcode data…but it cannot be extracted from that exe. I want to use the barcode data to be extracted from that exe….and tht’s why I started preparing application….
Please reply..
Thanks
ApurvFor getting an extended image info you must:
- Check that driver of scanner supports ICAP_EXTIMAGEINFO capability. Go next, if capability supported and value of capability is set to True
- When image is acquired from scanner
- Create TW_EXTIMAGEINFO struct with necessary to you extended image info
- Query DG_IMAGE / DAT_EXTIMAGEINFO / MSG_GET operation
- Retrieve an extended image info from TW_EXTIMAGEINFO struct
More info about this process please read in TWAIN specification.
Best regards, Alexander
I have written the extImageInfo structure but still I am unable to fetch the barcode data from an image…please help…below is the code snippet..:
//CODE_BARCODETEXT
extinf.NumInfos = 1;
extinf.Info[0].NumItems = 2;
extinf.Info[0].InfoID = (short)TwEImgInf.barcodetext;rc = no(appid, srcds, TwDG.Image, TwDAT.ExtImageInfo, TwMSG.Get, extinf);
Thanks
You also need specify the item type.
And another thing: When you retrieve extended image info? You must retrieve image info between Xfer and EndXfer calls.
Best regards, Alexander
hello,
I am happy to inform you all that, I could retrieve the data from the application. But now I am stucked at somewhere else.
If I hide the user interface, it doesn’t read the barcode. So i have to write the “BARCODE ENABLING” code in my application. I added whole function to enable the barcode reading…but its not working…
I just want to ask here that, is there any property in twain that it can scan the document by taking the “current settings” of an exe instead of “default settings”…because it is taking default settings if I hide the User interface.
If I make visible user interface, then barcode is read properly….
please help … 🙁
AnonymousPlease look at this barcode recognition component.
You can try to read barcode using C#.
BizCode Barcode Reader for .NET SDK support many commonly-used linear and matrix barcode symbologies covering several industries, including ISO/IEC specified Code 39, Code 128, Interleaved 2 of 5, GS1 specified EAN-8, EAN-13, UPC-A and UPC-E, as well as popular two-dimensional / 2D barcodes Data Matrix, QR Code and PDF-417.If twain application has the function to decode barcode image, then it should be easy to output scanning result to other applications.
is there any property in twain that it can scan the document by taking the “current settings” of an exe instead of “default settings”…
You can use CAP_CUSTOMDSDATA to check if the source supports setting DAT_CUSTOMDSDATA.
- AuthorPosts