corelibraries-devexpress-dot-xtraprinting-dot-barcode-ce753c1e.md
Generates an Aztec Code barcode.
Namespace : DevExpress.XtraPrinting.BarCode
Assembly : DevExpress.Printing.v25.2.Core.dll
NuGet Package : DevExpress.Printing.Core
public class AztecCodeGenerator :
BarCode2DGenerator
Public Class AztecCodeGenerator
Inherits BarCode2DGenerator
Refer to the following topic for details on this type of barcode: Aztec Code.
You can specify the following properties specific to the Aztec Code barcode type:
AztecCodeGenerator.CompactionModeSpecifies whether text or binary mode should be used to encode the barcode’s data.AztecCodeGenerator.VersionSpecifies the Aztec Code version.AztecCodeGenerator.ErrorCorrectionLevelSpecifies the amount of redundancy built into the bar code to compensate for calculation errors.
The following code snippet generates an Aztec Code barcode and specifies its properties:
View Example: How to add a bar code to a report
using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Windows.Forms;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
public XRBarCode CreateAztecCode(string BarCodeText) {
// Create a barcode control.
XRBarCode barCode = new XRBarCode();
// Set the barcode's type to Aztec Code.
barCode.Symbology = new AztecCodeGenerator();
// Adjust the barcode's main properties.
barCode.Text = BarCodeText;
barCode.Width = 300;
barCode.Height = 100;
// Adjust the properties specific to the barcode type.
((AztecCodeGenerator)barCode.Symbology).Version = AztecCodeVersion.Version27x27;
((AztecCodeGenerator)barCode.Symbology).ErrorCorrectionLevel = AztecCodeErrorCorrectionLevel.Level1;
((AztecCodeGenerator)barCode.Symbology).CompactionMode = AztecCodeCompactionMode.Text;
return barCode;
}
Imports System
Imports System.Collections.Generic
Imports System.Drawing.Printing
Imports System.Windows.Forms
Imports DevExpress.XtraPrinting.BarCode
Imports DevExpress.XtraReports.UI
Public Function CreateAztecCode(ByVal BarCodeText As String) As XRBarCode
' Create a barcode control.
Dim barCode As New XRBarCode()
' Set the barcode's type to Aztec Code.
barCode.Symbology = New AztecCodeGenerator()
' Adjust the barcode's main properties.
barCode.Text = BarCodeText
barCode.Width = 300
barCode.Height = 100
' Adjust the properties specific to the barcode type.
CType(barCode.Symbology, AztecCodeGenerator).Version = AztecCodeVersion.Version27x27
CType(barCode.Symbology, AztecCodeGenerator).ErrorCorrectionLevel = AztecCodeErrorCorrectionLevel.Level1
CType(barCode.Symbology, AztecCodeGenerator).CompactionMode = AztecCodeCompactionMode.Text
Return barCode
End Function
Object DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase BarCodeGeneratorBase BarCode2DGenerator AztecCodeGenerator
See Also