Page 1 of 1

Barcode Recognition

Posted: Wed Mar 31, 2010 11:52 pm
by bjwood
I am using GDTwain2.ocx. According to the documentation I need to call SetLicenseNumber1DBarcodeRecognition to turn on barcode recognition. I have downloaded the latest version of the control (2.6) yet the web site says it should be 2.7. The SetLicenseNumber1DBarcodeRecognition does not exist. Can anyone help?

Re: Barcode Recognition

Posted: Thu Apr 01, 2010 4:12 pm
by Loïc
Hi,

We got a problem in our version management. The latest version available of GdTwain should be 2.6.17.
However the SetLicenseNumber1DBarcodeRecognition exists. Please ensure to link your application to the last gdtwain2.ocx toolkit.

With best regards,

Loïc

Re: Barcode Recognition

Posted: Thu Apr 01, 2010 5:59 pm
by bjwood
Can you have your developers check the GDTwain2.ocx. The SetLicenseNumber1DBarcodeRecognition is not in the GDTwain2.ocx bit it is in gdtwain2s.ocx. Is this function needed to read any barcodes or just certain ones? Do I need to purchase a separate license to read barcodes?

Thanks

Re: Barcode Recognition

Posted: Thu Apr 01, 2010 6:19 pm
by Loïc
Hi,

I just downloaded & installed the component on a new computer: no problem.

We have the method in gdtwain2.ocx & gdtwain2s.ocx

Please check you are downloading the toolkit from https://www.gdpicture.com/download/download-gdtwain.php

I suggest you to uninstall your current edition. Search your system for gdtwain2.ocx and remove all occurrences of the dll you can find.
Is this function needed to read any barcodes or just certain ones? Do I need to purchase a separate license to read barcodes?
You need an additional license: GdPicture 1D Barcode Recognition Plugin. Please see the plugin page to see supported barcodes: https://www.gdpicture.com/products/plugi ... nition.php

With best regards,

Loïc Carrère

Re: Barcode Recognition

Posted: Thu Apr 01, 2010 6:29 pm
by Loïc
Hi again,

Please ignore my previous post. I found a problem on our compilation server.

We will upload newest version of all GdPicture ActiveX tomorrow...

With best regards,

Loïc Carrère

Re: Barcode Recognition

Posted: Thu Apr 01, 2010 8:26 pm
by bjwood
Thanks, now I have another issues. I and using the GDTWain2s.ocx which does have the Barcode License function and I am trying to see if I can get it to work. I have a 30 day trial license. I am using VB6 and this is the function I am calling:

Code: Select all

Private Sub fnTest()

   Dim ImageID As Long
   'Dim Twain1 As New GdPicture.GdPictureImaging
   Dim BarCodeCount As Long
   Dim i As Long
   Dim sKey As String
   Dim bRetVal As Boolean
   Dim lRetVal As GdPictureStatus
   Dim lW As Long
   Dim lH As Long
   
   sKey = "XXX"
   
   bRetVal = Twain1.SetLicenseNumber(sKey)  'Replace XXX by a valid demo or commercial license KEY
   bRetVal = Twain1.SetLicenseNumber1DBarcodeRecognition(sKey)  'Replace XXX by a valid demo or commercial license KEY
   If Twain1.TwainOpenDefaultSource() Then
      'If Twain1.TwainIsBarcodeDetectionAvailable Then
         'bRetVal = Twain1.TwainSetBarcodeDetection(True)
         
         Twain1.TwainSetHideUI (True)
         Twain1.TwainSetIndicators (True)
         Twain1.TwainSetAutoBrightness (True)
         Twain1.TwainSetCurrentContrast (0)
         Twain1.TwainEnableDuplex (False)

         Twain1.TwainSetAutoFeed (True) ' // 'Set AutoFeed Enabled
         Twain1.TwainSetAutoScan (True) ' // 'To  achieve the maximum scanning rate

         'Twain1.TwainSetCurrentResolution (72)
         Twain1.TwainSetCurrentPixelType (TWPT_BW) ' //TWPT_GRAY); // 'RGB
         Twain1.TwainSetCurrentBitDepth (8) ' // ' 24 bpp

         'Twain1.TwainPdfStart('c:\\scanimg\\multipage.pdf', '', '', '', '')

         ImageID = Twain1.TwainAcquireToGdPictureImage(Me.hWnd)
         'DisplayNativeImage
         lW = Twain1.GetWidth()
         lH = Twain1.GetHeight()
         Twain1.SetROI 0, 0, lW, lH
            bRetVal = Twain1.TwainLogStart("c:\TwinLog.Log")

         lRetVal = Twain1.Barcode1DReaderDoScan(BestQuality)
         Twain1.TwainLogStop
         For i = 1 To Twain1.Barcode1DReaderGetBarcodeCount
            MsgBox "Value: " + Twain1.Barcode1DReaderGetBarcodeValue(i)
            MsgBox "Type: " + Str(Twain1.Barcode1DReaderGetBarcodeType(i))
            MsgBox "Angle: " + Str(Twain1.Barcode1DReaderGetBarcodeSkewAngle(i))
         Next i
         Twain1.Barcode1DReaderClear
         Twain1.CloseNativeImage

      Twain1.TwainCloseSource
         MsgBox ("Done !")
   Else
      MsgBox ("can't open default source, twain state is: " & Twain1.TwainGetState)
   End If


End Sub
I am scanning a page that I printed multiple barcodes but the 'Barcode1DReaderGetBarcodeCount' function is returning 0. Can you see what I am missing? Do you have any ideas? I need this to work and if we can get there, we will be purchasing a license.

Thanks

Re: Barcode Recognition

Posted: Thu Apr 01, 2010 10:15 pm
by Loïc
Hi,

Your code seems good.
Could you attach the scanned image ? (or send it to essuport (at) gdpicture (dot) com if it is confidential).

You can save the image adding:

Code: Select all

TwainSaveAsTiff("test.tif")
Just before:

Code: Select all

Twain1.CloseNativeImage
With best regards,

Loïc

Re: Barcode Recognition

Posted: Thu Apr 01, 2010 11:21 pm
by bjwood
The tif is in the zip file. Thanks for your help!

Re: Barcode Recognition

Posted: Fri Apr 02, 2010 9:49 am
by Loïc
Hi,

The page you attached contains barcodes which doesn't meet any standard barcode symbology.

I don't know what is the tool used to create barcodes but I suggest you to switch the barcode type to a standard one. ie: code93, code128, ean13... See our barcode reader plugin page for an exhaustive list.

With best regards,

Loïc Carrère