bardecode.com
barcode reading software
  • Home
  • Download
  • Purchase
  • SDK Licensing
  • Pricing
    • Windows SDK Price List
    • Windows SDK with PDF Extension Price List
    • PDF Extension For Windows Price List
    • Linux SDK Price List
    • Multi-Platform Toolkit for .Net/Docker Price List
    • BardecodeFiler Desktop Only Price List
    • BardecodeFiler Windows Service Price List
    • DOS Command Prompt Barcode Tool Price List
  • Products
    • Barcode Reader Toolkit for Windows
    • Barcode Reader Toolkit for Linux
    • BardecodeFiler Application Desktop Only
    • BardecodeFiler Application & Windows Service
    • Windows DOS Command Prompt Barcode Tool
    • Multi-Platform Barcode Reader Toolkit for .Net Standard on Docker
    • Aquaforest’s Autobahn DX
  • Knowledge Base
    • Documentation
    • Specifications
  • News
  • Contact
    • About Us
    • Resellers
    • Links
Select Page ...

News

Reading Barcodes with Delphi using com

admin November 27, 2012 Settings, Software Development Kits No Comments

Using the Softek Barcode Reader SDK with Delphi is pretty straight forward and we include a full example project with our download. This page aims to get you up and running in less than 15 minutes…

Note that this example uses the COM interface to the SDK. If you would rather use the win32 DLL interface then click here.

Step 1.

Download the barcode reader sdk from here

Step 2.

Navigate to where the sdk was installed and open the x86 folder, right click on REGISTER.BAT and select “Run as Administrator”. This will run regsvr32 on SoftekATL.dll – which is the dll you will be using later on.

Step 3.

Open Delphi and start a new forms project or open the one you want to use for barcode reading.

Click on Component followed by Import Component to start the “Import Component Wizard”…

 

Click on Next to “Import a Type Library”

Scroll down to and click on “SoftekATL X.X.X Type Library”

Then click through the rest of the wizard taking the defaults.

 

Step 4.

Open your PAS file (e.g Unit1.pas) and add SoftekATL_TLB to the “uses” section.

e.g:

 

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, SoftekATL_TLB;

 

Step 5:

Declare a variable called oBarcode of type CBarcode and some other variables for the example code below:

var
	oBarcode: CBarcode;
	i: Integer;
	barcodeValue: String;
	nBarCodes: Integer;

 

Step 6:

In the procedure where you want to read the barcodes add the following code:

oBarcode := CoCBarcode.Create;
oBarcode.MultipleRead := 1;
oBarcode.ScanBarcode('someimage.tif');
nBarCodes := oBarcode.BarCodeCount;
if (nBarcodes > 0) then
begin
	for i := 1 to nBarcodes do
	begin
 		barcodeValue := oBarcode.BarString[i];
	end;
end;

 

Step 7:

That’s it – all done. But don’t forget that there is a lot more to the sdk than just this. If you have any questions then please contactsupport@bardecode.com .

You also might wish to add some extra lines of code to turn on or off various barcode types and maybe set a license key:

oBarcode.ReadQrCode := 1;
oBarcode.LicenseKey := 'MY LICENSE KEY';
← How to convert UTF-8 data into a String
Reading Barcodes with Delphi using win32 dll →
admin

  • Copyright © 2021 Softek Software Ltd. All Rights Reserved