GS1 DataBar
- 2 minutes to read
GS1 DataBar is a family of compact barcodes used for retail and coupon workflows. The symbology can encode up to 14 digits for GTIN-8, GTIN-12, GTIN-13, and GTIN-14. GS1 DataBar Expanded and Expanded Stacked can encode up to 74 numeric or 41 alphanumeric characters and can include GS1 Application Identifiers such as expiration date, batch number, and serial number.
Examples
Configure Barcode Settings (DataBarOptions)
Use the DataBarOptions class to configure GS1 DataBar barcode settings.
The following code snippet creates an DataBar barcode and customizes its options:

using DevExpress.Docs.Barcode;
using DevExpress.Drawing;
using System.Drawing;
var databarOptions = new DataBarOptions();
databarOptions.ShowText = false;
databarOptions.Padding = new Padding(5);
databarOptions.BorderWidth = 1;
using var databarOptionsStream = new FileStream(Path.Combine(outDir, "barcode_symbology_gs1_databar.png"), FileMode.Create, FileAccess.Write);
using var databarOptionsGenerator = new BarcodeGenerator(databarOptions);
databarOptionsGenerator.Export("(01)09521234543213", databarOptionsStream, DXImageFormat.Png);
Configure Barcode Settings (Fluent API)
Use the DataBarOptionsBuilder class to configure GS1 DataBar barcode settings with Fluent API.
The following code snippet creates an DataBar barcode and customizes its options:

using DevExpress.Docs.Barcode;
using DevExpress.Drawing;
using System.Drawing;
var databarOptions = DataBarOptionsBuilder.Create()
.WithShowText(false)
.WithPadding(5)
.WithBorderWidth(1)
.Build();
using var databarOptionsStream = new FileStream(Path.Combine(outDir, "barcode_symbology_databar.png"), FileMode.Create, FileAccess.Write);
using var databarOptionsGenerator = new BarcodeGenerator(databarOptions);
databarOptionsGenerator.Export("(01)09521234543213", databarOptionsStream, DXImageFormat.Png);
Symbology-Specific Options
| Property | Description |
|---|---|
| Type | Gets or sets the symbol type of the GS1 DataBar barcode family. |
| SegmentsInRow | Gets or sets the number of data segments per row in the ExpandedStacked type of a GS1 DataBar barcode. |
| FNC1Substitute | Gets or sets the character that is used as a substitute for the FNC1 separator in GS1 DataBar input data. |
See Also