GS1-128 Barcode Generator in C#.

We all know that a barcode is a graphic symbol for identifying products. GS1-128 Barcodes are very common in the retail industry. The GS1-128 standard facilitates data exchange between companies worldwide. Essentially, it’s an eCommerce technology standard for providing accurate and reliable information about a product. In this article, we will learn how to generate GS1-128 barcodes. After following the mentioned steps, we will have our own GS1-128 Barcode Generator in C#. So let’s begin.

The article shall cover the following topics:

  1. C# GS1-128 Barcode Generator API
  2. What is GS1-128 Barcode?
  3. Understanding the GS1-128 Barcode
  4. Generate GS1-128 Barcode in C#
  5. Generate UPC-A GS1 128 Coupon
  6. Customize Barcode Appearance

C# GS1-128 Barcode Generator API

For generating GS1-128 barcodes, we will be using the Aspose.BarCode for .NET API. It allows generating and recognizing a wide range of 1D & 2D barcode types.

The BarcodeGenerator class of the API allows generating barcodes of the specified EncodeType. The EncodeType class allows specifying the type of barcode to encode. We can save the generated barcode image using the Save(string) method of this class.

Please either download the DLL of the API or install it using NuGet.

PM> Install-Package Aspose.BarCode

What is GS1-128 Barcode?

GS1-128 (formerly UCC/EAN-128) barcode is a machine-readable product identification code that stores data and provides information on products. This code is applied to packs and containers of goods to help facilitate the efficient distribution and usage of foodstuffs.

Thousands of industries worldwide use the GS1 barcode or Global Trade Item Number (GTIN). Customers and suppliers worldwide know GS1-128 barcodes for food, pharmaceuticals, and other commodities. It serves as an inventory management tool for manufacturers, retailers, and consumers. The GS1-128 codes are defined by the International Organization for Standardization (ISO) and published by the GS1 organization.

Understanding the GS1-128 Barcode

The GS1-128 barcode follows the following format:

(Application_Identifier_1)Application_Data(Application_Identifier_2)Application_Data

The GS1-128 barcode contains the following helpful information:

  • GTIN (Global Trade Item Number)
  • Serial numbers
  • Batch and lot numbers
  • Product dates
  • Origin and destination of the product
  • Nature of the product

Generate GS1-128 Barcode in C#

We can generate a GS1-128 barcode by following the steps given below:

  1. Firstly, create an instance of the BarcodeGenerator class with the EncodeType as an argument.
  2. Next, specify the text to encode.
  3. After that, set the barcode size value in pixels.
  4. Finally, save the output using the Save() method. It takes the output file path as an argument.

The following code example shows how to generate a GS1-128 barcode in C#.

Generate GS1-128 Barcode using C#

Generate GS1-128 Barcode using C#

Generate UPC-A GS1 128 Coupon in C#

Similarly, we can generate a barcode label with an additional GS1-128 coupon barcode placed in the same image by following the steps mentioned earlier. However, we need to set the EncodeType as UpcaGs1Code128Coupon in the first step.

The following code example shows how to generate a UPC-A GS1 Code 128 Coupon in C#.

Generate UPC-A GS1 128 Coupon in C#

Generate UPC-A GS1 128 Coupon in C#

Customize GS1 128 Coupon Appearance in C#

We can also customize the appearance of the barcode by following the steps mentioned earlier. However, we need to specify additional properties before saving the image in the final step.

The following code example shows how to customize the barcode appearance of GS1 128 Coupon in C#.

Customize the colors and coupon supplement space in C#

Customize the colors and coupon supplement space in C#

Get a Free License

You can get a free temporary license to try the library without evaluation limitations.

Conclusion

In this article, we have learned about GS1-128 barode and how to generate a GS1-128 barcode in C#. We have also seen how to generate UPC-A GS1-128 coupon programmatically. Besides, you can learn more about Aspose.BarCode for .NET API using documentation. In case of any ambiguity, please feel free to contact us on our free support forum.

See Also