Sobre o Softek Barcode Toolkit PDF Extension

Amplie a funcionalidade do Barcode Toolkit for Windows para ler os códigos de barras de documentos PDF.

Softek Barcode Reader Toolkit lets you read barcodes from image files and bitmaps held in memory. Developers have a choice of 4 different types of interface and access to several example projects. The toolkit also includes free controls to display images and create Code 39 barcodes.

The Softek Barcode Toolkit for Windows PDF Extension enables you to read barcodes from PDF documents.

The PDF Extension adds PDF capability to the following interfaces of the Windows version of the toolkit:

  • Standard Windows DLL
  • COM Object
  • VB Wrapper Class
  • ActiveX/OCX

Please note: PDF capability cannot currently be added to the Managed Component. PDF capability can only be added to version 6.1.0 or later of the Softek Barcode Toolkit for Windows.

The Softek Barcode Toolkit enables application programmers to read barcodes from image files and bitmaps held in memory. The image files can be from any source, but will typically come from a scanner or computer fax modem. The barcode recognition engine is contained in a single library file, which makes product upgrades a simple matter. The application programmer has the choice of 4 different interfaces to choose from. The choice of interface will depend on the type of language being used and the type of application to be developed.

A few lines of code are all that is needed to read a barcode from an image. As can be seen from this example using the Active X control:

nBarStrings = SoftekBarcode1.ScanBarCode(ImageFile)
If (nBarStrings > 0) Then
    For n = 1 To nBarStrings
    BarString = SoftekBarcode1.GetBarString(n)
    MsgBox (BarString)
    Next n
End If

As the above code shows, it’s a simple two-step process to read a barcode.

Softek Barcode Reader Toolikit has the following Toolkit interfaces:

  • DLL Interface - The DLL allows programmers to access the properties and methods of the toolkit via functions prefixed with "st". For example, the ScanBarcode method is called stScanBarcode and the LineJump property can is set and retrieved using the functions SetLineJump and GetLineJump
  • Active X Control or OCX - The Active X Control can be embedded in a form or dialog and the methods and properties of the toolkit accessed through the associated object
  • Visual Basic Wrapper Class - The wrapper class provides access to the DLL via a simple Visual Basic class. Most of the properties and methods of the toolkit are supported through this interface
  • COM Object - The COM object allows access to most of the properties and methods in the toolkit, although some of the methods differ slightly in operation from the other interfaces.
  • 100% Managed .Net Component - The managed component allows programmers working within the .Net framework to access most of the methods and properties of the toolkit. This interface is also thread safe

Image Formats:

  • TIF
  • JPG
  • BMP

The following types of barcode are currently supported:

  • CODE-39
  • CODE-128
  • CODE-2-of-5 Interleaved
  • Codabar
  • EAN-8
  • EAN-13
  • Patch Codes
  • UPC-A
  • UPC-E

Barcode Widths:
The main requirement is for each black or white bar in a barcode to be clearly visible on the image. All barcodes have at least 2 sizes of bar and the image needs to be of high enough quality to show this. For example, a Code 39 barcode consists of 9 bars per character, of which 3 must be wide and 6 must be narrow. The wide bars should be around 2.5 times the size of the narrow bars - but for simplicity we will say 2 times the size. This means that each character needs at least 12 pixels in an image. This assumes that each pixel in the image lies either entirely in a black bar or entirely in a white bar. In practise, this isn't possible and so the resolution should allow around 36 pixels per character.

So, to encode a string of 10 characters (including the start and stop *) you will need at around 360 pixels. If the barcode is 1 inch wide on the paper then you will need to scan at a resolution of around 400 DPI. If the barcode is 2 inches wide then you will need to scan at a resolution of at least 200 DPI.

Some types of barcode have more than 2 widths of bar and a higher resolution still will be needed to ensure that the different widths can be distinguished on the image.

As for barcode height - if you have a very wide barcode then you need to ensure that it is high enough to cope with any skewing that takes place when the image is scanned.

In summary - the success of a project can depend on specifying the correct barcode size and image resolution.

  • Code 39 Number of Characters 10, Minimum Number of Pixels (approx) 340
  • Code 2 of 5 (interleaved) Number of Characters 10, Minimum Number of Pixels (approx) 190
  • Code 128 (code set A) Number of Characters 10, Minimum Number of Pixels (approx) 280
  • Code 128 (code set B) Number of Characters 10, Minimum Number of Pixels (approx) 280
  • Code 128 (code set C) Number of Characters 10, Minimum Number of Pixels (approx) 170
  • EAN-13 Number of Characters 13, Minimum Number of Pixels (approx) 190
  • EAN-8 Number of Characters 8, Minimum Number of Pixels (approx) 140
  • UPC-A Number of Characters 12, Minimum Number of Pixels (approx) 190
  • UPC-E Number of Characters 8, Minimum Number of Pixels (approx) 120