←Select platform

BarcodeSymbology Enumeration

Summary
The barcode symbologies supported by LEADTOOLS.
Syntax
C#
Objective-C
C++/CLI
Java
Python
[SerializableAttribute()] 
[DataContractAttribute()] 
public enum BarcodeSymbology 
typedef NS_ENUM(NSInteger, LTBarcodeSymbology) { 
 LTBarcodeSymbologyUnknown,  
 LTBarcodeSymbologyEAN13,  
 LTBarcodeSymbologyEAN8,  
 LTBarcodeSymbologyUPCA,  
 LTBarcodeSymbologyUPCE,  
 LTBarcodeSymbologyCode3Of9,  
 LTBarcodeSymbologyCode128,  
 LTBarcodeSymbologyCodeInterleaved2Of5,  
 LTBarcodeSymbologyCodabar,  
 LTBarcodeSymbologyUCCEAN128,  
 LTBarcodeSymbologyCode93,  
 LTBarcodeSymbologyEANEXT5,  
 LTBarcodeSymbologyEANEXT2,  
 LTBarcodeSymbologyMSI,  
 LTBarcodeSymbologyCode11,  
 LTBarcodeSymbologyCodeStandard2Of5,  
 LTBarcodeSymbologyGS1Databar,  
 LTBarcodeSymbologyGS1DatabarLimited,  
 LTBarcodeSymbologyGS1DatabarExpanded,  
 LTBarcodeSymbologyPatchCode,  
 LTBarcodeSymbologyPostNet,  
 LTBarcodeSymbologyPlanet,  
 LTBarcodeSymbologyAustralianPost4State,  
 LTBarcodeSymbologyRoyalMail4State,  
 LTBarcodeSymbologyUSPS4State,  
 LTBarcodeSymbologyGS1DatabarStacked,  
 LTBarcodeSymbologyGS1DatabarExpandedStacked,  
 LTBarcodeSymbologyPDF417,  
 LTBarcodeSymbologyMicroPDF417,  
 LTBarcodeSymbologyDatamatrix,  
 LTBarcodeSymbologyQR,  
 LTBarcodeSymbologyAztec,  
 LTBarcodeSymbologyMaxi,  
 LTBarcodeSymbologyMicroQR,  
 LTBarcodeSymbologyPharmaCode 
}; 
public enum BarcodeSymbology 
[DataContractAttribute()] 
[SerializableAttribute()] 
public enum class BarcodeSymbology   
class BarcodeSymbology(Enum): 
   Unknown = 0 
   EAN13 = 1 
   EAN8 = 2 
   UPCA = 3 
   UPCE = 4 
   Code3Of9 = 5 
   Code128 = 6 
   CodeInterleaved2Of5 = 7 
   Codabar = 8 
   UCCEAN128 = 9 
   Code93 = 10 
   EANEXT5 = 11 
   EANEXT2 = 12 
   MSI = 13 
   Code11 = 14 
   CodeStandard2Of5 = 15 
   GS1Databar = 16 
   GS1DatabarLimited = 17 
   GS1DatabarExpanded = 18 
   PatchCode = 19 
   PostNet = 20 
   Planet = 21 
   AustralianPost4State = 22 
   RoyalMail4State = 23 
   USPS4State = 24 
   GS1DatabarStacked = 25 
   GS1DatabarExpandedStacked = 26 
   PDF417 = 27 
   MicroPDF417 = 28 
   Datamatrix = 29 
   QR = 30 
   Aztec = 31 
   Maxi = 32 
   MicroQR = 33 
   PharmaCode = 34 
Members
ValueMemberDescription
0Unknown

Unknown symbology type. This has a special meaning in some of the methods that use BarcodeSymbology. For example, you can pass Unknown as the symbology parameter for the BarcodeReader.ReadBarcode method to indicate that the barcode type is unknown. It will also instruct the engine to read the first barcode found in the image using the other parameters.

1EAN13

EAN-13 (International Article Number with 13 digits) symbology. Used internationally with consumer products.

2EAN8

EAN-8. Derived from the longer European Article Number (EAN-13) code. It was introduced for use on small packages where an EAN-13 barcode would be too large.

3UPCA

UPC-A (Universal Product Code). Used with consumer products in the United States.

4UPCE

UPC-E. The short version of UPC-A.

5Code3Of9

Code 3 of 9 (Code 39) type. Used especially in non-retail environments.

6Code128

Code 128 type. Very dense code, used extensively worldwide.

7CodeInterleaved2Of5

Interleaved 2 of 5 type. Used in warehouse, industrial applications.

8Codabar

CODABAR (Ames Code/USD-4/NW-7/2 of 7 Code) type. Used in libraries and blood banks.

9UCCEAN128

UCCEAND 128 type

10Code93

Code 93 type. Compressed form of Code 39

11EANEXT5

5-digit supplemental type. May be used with UPCA, UPCE, EAN13 and EAN8 on books to indicate a suggested retail price.

12EANEXT2

2-digit supplemental type. May be used with UPCA, UPCE, EAN13 and EAN8 to indicate magazines and newspaper issue numbers.

13MSI

MSI (Modified Plessey) type. Used to mark retail shelves for inventory control.

14Code11

Code 11 (USD-8) type. Used in labeling telecommunications equipment.

15CodeStandard2Of5

Standard 2 of 5 (Industrial 2 of 5) type. Used in the photofinishing, warehouse sorting industries and sequentially numbering airline tickets.

16GS1Databar

GS1 Databar (formerly RSS14) type. Used in grocery industry, healthcare, and where items are too small to allow for older barcode symbologies.

17GS1DatabarLimited

GS1 Databar (formerly RSS14) Limited type. It is a short version of GS1 Databar (formerly RSS14).

18GS1DatabarExpanded

GS1 Databar (formerly RSS14) Expanded type. It encodes item identification plus supplementary strings such as weight and date. Used in grocery industry and healthcare.

19PatchCode

Patch Code type. Used only for batch separation and scanner control, primarily with Kodak scanners.

20PostNet

POSTNET (Postal Numeric Encoding Technique). Used by the United States Postal Service to assist in directing mail.

21Planet

PLANET (Postal Alpha Numeric Encoding Technique). Used by the United States Postal Service to identify and track pieces of mail during delivery.

22AustralianPost4State

Australian Post 4-State type.

23RoyalMail4State

Royal Mail (RM4SCC) 4-State type.

24USPS4State

USPS OneCode 4-State Barcode (4BC) type.

25GS1DatabarStacked

GS1 Databar (formerly RSS14) Stacked / GS1 Databar Stacked Omni-Directional types. Used as GS1 Databar when the available space is too narrow for the standard GS1 Databar.

26GS1DatabarExpandedStacked

GS1 Databar (formerly RSS14) Expanded Stacked barcode type. Used as GS1 Databar Expanded when the available space is too narrow to fit in one line.

27PDF417

PDF417 (Portable Data File). 2D symbol used in a variety of applications, primarily transport, identification cards, and inventory management. Note, the PDF417 barcode symbology does not have any relation to Adobe PDF (Portable Document Format).

28MicroPDF417

MicroPDF417 (Portable Data File). Version of PDF417 that can hold up to 150 bytes of data. Note, the MicroPDF417 barcode symbology does not have any relation to Adobe PDF (Portable Document Format).

29Datamatrix

Datamatrix. 2D symbol code used for marking small items.

30QR

QR (short for Quick Response). 2D symbol used by dedicated QR barcode readers and camera phones.

31Aztec

Aztec. 2D symbol used for train tickets, airline tickets and government documents. This barcode is able to reduce the required space over other matrix barcode as it does not require a surrounding quiet zone.

32Maxi

MaxiCode. 2D symbol developed and used by the United Parcel Service to identify and track pieces of mail during delivery.

33MicroQR

Micro QR. 2D symbol used where symbol size is limited. There are four sizes; the largest is capable of encoding 35 characters. Some sizes support more than one error correction level.

34PharmaCode

PharmaCode type. Used in the pharmaceutical industry as a packing control system.

Remarks

To get a list of all the barcode symbologies supported by LEADTOOLS, use BarcodeEngine.GetSupportedSymbologies, to get a list of the read or write symbologies currently available (support has been unlocked and the backend runtime assembly exists), use BarcodeReader.GetAvailableSymbologies and BarcodeWriter.GetAvailableSymbologies.

For description and visual samples of the barcode symbologies supported by LEADTOOLS, refer to Supported Barcode Symbologies.

The BarcodeEngine.GetSymbologyFriendlyName method can be used to return a string that contains a friendly name for any BarcodeSymbology enumeration member.

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Barcode; 
using Leadtools.ImageProcessing; 
 
 
public void BarcodeWriter_Example() 
{ 
   // Create a directory to store the images we will create 
   string outDir = Path.Combine(LEAD_VARS.ImagesDir, "MyBarcodes"); 
   if (Directory.Exists(outDir)) 
   { 
      Directory.Delete(outDir, true); 
   } 
   Directory.CreateDirectory(outDir); 
 
   int resolution = 300; 
 
   // Create a Barcode engine 
   BarcodeEngine engine = new BarcodeEngine(); 
 
   // Get the Barcode writer 
   BarcodeWriter writer = engine.Writer; 
 
   // All 1D options have the UseXModule set to false by default, we need to set it to true 
   // so we can calculate the default size. We will change the default options so we can 
   // pass null to CalculateBarcodeDataBounds and WriteBarcode below 
 
   // For all Standard 1D 
   OneDBarcodeWriteOptions oneDWriteOptions = writer.GetDefaultOptions(BarcodeSymbology.UPCA) as OneDBarcodeWriteOptions; 
   oneDWriteOptions.UseXModule = true; 
 
   // All GS1 Databar Stacked 
   GS1DatabarStackedBarcodeWriteOptions gs1DatabarStackedWriteOptions = writer.GetDefaultOptions(BarcodeSymbology.GS1DatabarStacked) as GS1DatabarStackedBarcodeWriteOptions; 
   gs1DatabarStackedWriteOptions.UseXModule = true; 
 
   // Patch Code 
   PatchCodeBarcodeWriteOptions patchCodeWriteOptions = writer.GetDefaultOptions(BarcodeSymbology.PatchCode) as PatchCodeBarcodeWriteOptions; 
   patchCodeWriteOptions.UseXModule = true; 
 
   // All PostNet/Planet 
   PostNetPlanetBarcodeWriteOptions postNetPlanetWriteOptions = writer.GetDefaultOptions(BarcodeSymbology.PostNet) as PostNetPlanetBarcodeWriteOptions; 
   postNetPlanetWriteOptions.UseXModule = true; 
 
   // We will use this object to save files 
   using (RasterCodecs codecs = new RasterCodecs()) 
   { 
      // Get all the available write symbologies 
      BarcodeSymbology[] symbologies = writer.GetAvailableSymbologies(); 
      foreach (BarcodeSymbology symbology in symbologies) 
      { 
         Console.WriteLine("Processing {0}", symbology); 
 
         // Create the default data for this symbology 
         BarcodeData data = BarcodeData.CreateDefaultBarcodeData(symbology); 
 
         // Calculate its size with default options 
         writer.CalculateBarcodeDataBounds(LeadRect.Empty, resolution, resolution, data, null); 
 
         // Create an image to write the data to 
         LeadRect pixels = data.Bounds; 
         using (RasterImage image = RasterImage.Create(pixels.Width, pixels.Height, 1, resolution, RasterColor.FromKnownColor(RasterKnownColor.White))) 
         { 
            // Write the barcode with default options 
            writer.WriteBarcode(image, data, null); 
 
            // Save it 
            string outFileName = Path.Combine(outDir, symbology + ".tif"); 
            codecs.Save(image, outFileName, RasterImageFormat.Tif, 1); 
         } 
      } 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
 
import static org.junit.Assert.assertTrue; 
 
import java.io.File; 
import java.io.IOException; 
import java.nio.file.Path; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
 
import leadtools.*; 
import leadtools.barcode.*; 
import leadtools.codecs.*; 
 
 
public void barcodeWriterExample() { 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
 
   // Create a directory to store the images we will create 
   String outDir = combine(LEAD_VARS_IMAGES_DIR, "MyBarcodes"); 
   File dir = new File(outDir); 
   if (dir.exists()) { 
      dir.delete(); 
   } 
   dir.mkdirs(); 
   int resolution = 300; 
 
   // Create a Barcode engine 
   BarcodeEngine engine = new BarcodeEngine(); 
 
   // Get the Barcode writer 
   BarcodeWriter writer = engine.getWriter(); 
 
   // All 1D options have the UseXModule set to false by default, we need to set it 
   // to true 
   // so we can calculate the default size. We will change the default options so 
   // we can 
   // pass null to CalculateBarcodeDataBounds and WriteBarcode below 
 
   // For all Standard 1D 
   OneDBarcodeWriteOptions oneDWriteOptions = (OneDBarcodeWriteOptions) writer 
         .getDefaultOptions(BarcodeSymbology.UPC_A); 
   oneDWriteOptions.setUseXModule(true); 
 
   // All GS1 Databar Stacked 
   GS1DatabarStackedBarcodeWriteOptions gs1DatabarStackedWriteOptions = (GS1DatabarStackedBarcodeWriteOptions) writer 
         .getDefaultOptions(BarcodeSymbology.GS1_DATA_BAR_STACKED); 
   gs1DatabarStackedWriteOptions.setUseXModule(true); 
 
   // Patch Code 
   PatchCodeBarcodeWriteOptions patchCodeWriteOptions = (PatchCodeBarcodeWriteOptions) writer 
         .getDefaultOptions(BarcodeSymbology.PATCH_CODE); 
   patchCodeWriteOptions.setUseXModule(true); 
 
   // All PostNet/Planet 
   PostNetPlanetBarcodeWriteOptions postNetPlanetWriteOptions = (PostNetPlanetBarcodeWriteOptions) writer 
         .getDefaultOptions(BarcodeSymbology.POST_NET); 
   postNetPlanetWriteOptions.setUseXModule(true); 
 
   // We will use this object to save files 
   RasterCodecs codecs = new RasterCodecs(); 
 
   // Get all the available write symbologies 
   BarcodeSymbology[] symbologies = writer.getAvailableSymbologies(); 
 
   for (BarcodeSymbology symbology : symbologies) { 
      System.out.printf("Processing %1s%n", symbology); 
 
      // Create the default data for this symbology 
      BarcodeData data = BarcodeData.createDefaultBarcodeData(symbology); 
 
      // Calculate its size with default options 
      writer.calculateBarcodeDataBounds(LeadRect.getEmpty(), resolution, resolution, data, null); 
 
      // Create an image to write the data to 
      LeadRect pixels = data.getBounds(); 
      RasterImage image = RasterImage.create(pixels.getWidth(), pixels.getHeight(), 1, resolution, 
            RasterColor.fromKnownColor(RasterKnownColor.WHITE)); 
 
      // Write the barcode with default options 
      writer.writeBarcode(image, data, null); 
 
      // Save it 
      String outFileName = combine(outDir, symbology + ".tif"); 
      codecs.save(image, outFileName, RasterImageFormat.TIF, 1); 
 
      assertTrue("File saves to " + outFileName, (new File(outFileName)).exists()); 
      System.out.println("All RasterImages were saved to the output File"); 
 
   } 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Barcode Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.