Detecting & Reading barcodes from PDF

Example requests & Code samples for GdPicture Toolkits.
Post Reply
User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Detecting & Reading barcodes from PDF

Post by Loïc » Sat Oct 17, 2009 5:28 pm

Hi,

Here a sample to detect & read all barcode of a PDF using GdPicture Pro Imaging SDK.

Note: This sample work with PDF and all king of image supported by the toolkit.

Code: Select all

 Dim oImaging As Object, oGdViewer As Object
 Dim i As Integer
 Set oImaging = CreateObject("gdpicturepro5.Imaging")
 Set oGdViewer = CreateObject("gdpicturepro5.GdViewer")

 
 oGdViewer.SetLicenseNumber ("XXXX") 'Please, replace XXXX by a valid demo or commercial license key.
 oImaging.SetLicenseNumber ("XXXX") 'Please, replace XXXX by a valid demo or commercial license key.
 oImaging.SetLicenseNumber1DBarcodeRecognition ("XXXX") 'Please, replace XXXX by a valid demo or commercial license key.
 
 oGdViewer.DisplayFromPdfFile ("c:\test.pdf")
 oImaging.SetNativeImage (oGdViewer.GetNativeImage)
 oImaging.ConvertTo1Bpp 'Should provide best accuracy in 1bpp mode. 
 oImaging.Barcode1DReaderDoScan (BestQuality)
 For i = 1 To oImaging.Barcode1DReaderGetBarcodeCount
    MsgBox "Value: " + oImaging.Barcode1DReaderGetBarcodeValue(i)
    MsgBox "Type: " + Str(oImaging.Barcode1DReaderGetBarcodeType(i))
    MsgBox "Angle: " + Str(oImaging.Barcode1DReaderGetBarcodeSkewAngle(i))
 Next i
 oImaging.Barcode1DReaderClear
 oGdViewer.CloseImage

ditte
Posts: 48
Joined: Tue Jul 17, 2007 9:49 am
Location: Berlin, Germany

Re: Detecting & Reading barcodes from PDF

Post by ditte » Wed Feb 17, 2010 2:32 pm

Hi Loïc,

I´ve tested this sample with a demo pdf file "test.pdf".
There are 9 Barcodes included.
I think that the solution is good. I will send it by mail.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests