dLSoft  barcode & labelling software     

Barcode components for Delphi

The dLSoft dBarcode DLL products consist of C/C++ DLLs and include Delphi components (derived from TImage) and full sample source code illustrating the writing of barcode applications in Delphi. These component are provided in source form in both Unicode versions (sutiable for Delphi 2009 or later) and Ansi version (sutiable for older version of Delphi.

Delphi component screen shot - click on images to enlarge

Delphi design view

Design view in Delphi

Products

The dBarcode DLL product range includes a Universal product, which may be licenced for 1D, 2D or both barcodes, and several other libraries that support specific barcode types.

 

Product

Supports

dBarcode DLL – Universal

includes most 1D and 2d types*.

dBarcode DLL – Standard

Code 39, Extended 39, Code 93, Extended 93, Code 128, Interleaved 2 of 5 and Matrix 2 of 5

dBarcode DLL – GS1

EAN-13/8, UPC-A/-E (with supplementaries), EAN/UCC 14, GS1-128, ITF and SSCC

dBarcode DLL – Aztec

Aztec

dBarcode DLL – DataMatrix

DataMatrix

dBarcode DLL – MaxiCode

MaxiCode

dBarcode DLL – PDF417

PDF417, Truncated PDF417 & MicroPDF

dBarcode DLL – QR

QR Code, Micro QR Code

dBarcode DLL – Databar

GS1-Databar (formerly RSS)

Download a TestWare version now

Features

View the product Help file or manual.

*dBarcode DLL - Universal (1D and Dual licences) supports the following 1D barcode types: 2 of 5, 3 of 9, Australia Post, Codabar, Code 11, Code 39, Extended Code 39, Code 93, Extended Code 93, Code 128, Code B, Deutschen Post, DUN14, EAN- 8, EAN-13, EAN-14, EAN-128/UCC-128, ISBN, ISMN, ISSN, IATA 2 of 5, ITF-14, ITF-6, Interleaved 2 of 5, InfoMail, Intelligent Mail (OneCode), Intelligent Mail Package Barcode, Italian Post 2/5, Italian Post 3/9, Japan Post, JAN, Korean Postal Authority, Matrix 2 of 5, MSI (Modified Plessey), Planet, Plessey, PostNet & FIM, Royal Mail 4 State, SSCC, SICI/SISAC, Swiss Post, Telepen (numeric and ASCII), UCC-14, UPC-A, UPC-E.

dBarcode DLL - Universal (2D and Dual licences) supports Aztec, DataMatrix, Maxicode, PDF417,Truncated PDF417, MicroPDF, QR Code, Micro QR and GS1-DataBar (RSS).


System Requirements

Windows XP or later
Delphi Development environment, Delphi 2009 - XE4 for Unicode version, v6/7/8 for ANSI version.

Licensing

Each dLSoft dBarcode DLL may licensed as a single computer product or as a developer version which permits Royalty-free distribution of the DLL as part of the developer's own project for up to 10,000 distributions.


Using the components

The barcode component is based on the TImage and so inherits many of its properties from this object. Over and above this, the component supports properties specific to its application, in this case the production of Barcodes. The component can be placed on a form and its properties set a Design time or altered through code at Run-Time.
A sample application is included in the form of the dBarcode1 project, which includes the UNIT1.PAS source file.
A typical example is shown below

procedure TForm1.DoBarcode();
begin
Barcode1.Xunit:=20;
Barcode1.BarcodeType:=8;
Barcode1.Caption:=Edit1.Text;
errormessage.Text:=Barcode1.GetError(Barcode1.Error);
end;

Printing the barcode

To print a barcode image one approach is to Draw the Picture on the Printer.Canvas, as shown in the code sample below.
Note that the Picture is created in HIMETRIC units, and so to print the image at the correct size these must be converted into printer pixel units using the GetDeviceCaps() function.

procedure TForm1.Button2Click(Sender: TObject);
var
ii: integer;
jj: integer;
Rect: TRect;
pScalex: Integer;
pScaley: integer;
begin
DoBarcode(); {recreate the barcode image}
{set the target rectangle for drawing on the printer}
{change from mm to pixels}
pScalex:=GetDeviceCaps((Printer.Handle),LOGPIXELSX);
pScaley:=GetDeviceCaps((Printer.Handle),LOGPIXELSY);
ii:=(Barcode1.ImageWidth*pScalex) div 2540;
jj:=(Barcode1.ImageHeight*pScaley) div 2540;
Rect.Left:=200;
Rect.Top:=200;
Rect.Right:=Rect.Left+ii;
Rect.Bottom:=Rect.Top+jj;
Printer.BeginDoc;
Printer.Canvas.StretchDraw(Rect, Barcode1.Picture.Graphic);
Printer.EndDoc;
end;