Barcode Recognition

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
bjwood
Posts: 4
Joined: Wed Mar 31, 2010 11:46 pm

Barcode Recognition

Post by bjwood » Wed Mar 31, 2010 11:52 pm

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?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Barcode Recognition

Post by Loïc » Thu Apr 01, 2010 4:12 pm

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

bjwood
Posts: 4
Joined: Wed Mar 31, 2010 11:46 pm

Re: Barcode Recognition

Post by bjwood » Thu Apr 01, 2010 5:59 pm

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

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Barcode Recognition

Post by Loïc » Thu Apr 01, 2010 6:19 pm

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

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Barcode Recognition

Post by Loïc » Thu Apr 01, 2010 6:29 pm

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

bjwood
Posts: 4
Joined: Wed Mar 31, 2010 11:46 pm

Re: Barcode Recognition

Post by bjwood » Thu Apr 01, 2010 8:26 pm

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

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Barcode Recognition

Post by Loïc » Thu Apr 01, 2010 10:15 pm

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

bjwood
Posts: 4
Joined: Wed Mar 31, 2010 11:46 pm

Re: Barcode Recognition

Post by bjwood » Thu Apr 01, 2010 11:21 pm

The tif is in the zip file. Thanks for your help!
Attachments
test.zip
(25.88 KiB) Downloaded 350 times

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Barcode Recognition

Post by Loïc » Fri Apr 02, 2010 9:49 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest