PNG JPG BMP TIFF SVG
Aspose.BarCode  for .NET
GS1 DataBar

Generate GS1 DataBar Labels with .NET

Create GS1 DataBar (Omnidirectional, Stacked Omnidirectional, Expanded, Expanded Stacked, and Truncated) barcode in C# using server-side Aspose.BarCode for .NET API.

How to Generate GS1 DataBar barcode Using .NET

To create GS1 DataBar barcode, try Aspose.BarCode for .NET API, a feature-rich, powerful, and easy-to-use barcode library for C# platforms. Open the NuGet package manager, search for Aspose.BarCode and install the package. You may also run the following command from the Package Manager console:

Command

  PM> Install-Package Aspose.BarCode
  

Steps to Generate GS1 DataBar barcode in C#

Aspose.BarCode makes it easy for developers to create GS1 DataBar barcode images with few lines of code.

  • Create an instance of BarcodeGenerator class
  • Pass GS1 DataBar (Omnidirectional, Stacked Omnidirectional, Expanded, Expanded Stacked, and Truncated) barcode as a parameter
  • Set text to encode as the second parameter
  • Specify barcode dimensions if required
  • Call the BarcodeGenerator.Save method to obtain the GS1 DataBar (Omnidirectional, Stacked Omnidirectional, Expanded, Expanded Stacked, and Truncated) barcode image

System Requirements

Aspose barcode APIs are supported by all major platforms and operating systems. Before executing the code sample below, please check that you have the following prerequisites enabled in your system.

  • Microsoft Windows, Linux, or any OS compatible with .NET Framework, .NET Standard, COM Interloop for PHP, VBScript, Delphi, or C++
  • Development environment, such as Microsoft Visual Studio
  • Aspose.BarCode for .NET library DLL referenced in your project - install from NuGet using the Download button

Code to be executed - C#


// Initialize barcode generator
using (var generator = new Aspose.BarCode.Generation.BarcodeGenerator(EncodeTypes.Databar, ""))
{
  // Set parameters
  generator.Parameters.Barcode.XDimension.Millimeters *= 2;
  generator.Parameters.Barcode.CodeTextParameters.Location = CodeLocation.Below;

  // Generate image
  Bitmap res = generator.GenerateBarCodeImage();
}
Generation result