Skip to main content
All docs
V25.1
  • AztecCodeGenerator Class

    Generates an Aztec Code barcode.

    Namespace: DevExpress.XtraPrinting.BarCode

    Assembly: DevExpress.Printing.v25.1.Core.dll

    NuGet Package: DevExpress.Printing.Core

    Declaration

    public class AztecCodeGenerator :
        BarCode2DGenerator

    Remarks

    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.CompactionMode
    Specifies whether text or binary mode should be used to encode the barcode’s data.
    AztecCodeGenerator.Version
    Specifies the Aztec Code version.
    AztecCodeGenerator.ErrorCorrectionLevel
    Specifies 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;
    }
    

    Inheritance

    Object
    DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase
    See Also