Skip to main content
A newer version of this page is available. .

Code 93

  • 2 minutes to read

Short Description

Code 93 was designed to supplement and improve upon Code 39.

Code 93 is similar in that, like Code 39, can represent the full ASCII character set by using combinations of 2 characters. It differs in that Code 93 is a continuous symbology and produces denser code. It also encodes 47 characters (compared to Code 39‘s 43 characters).

Barcode - Code 93

Bar Code Properties

The type of a bar code control’s Symbology property is Code93Generator.

The following property is specific to the Code 93 type.

  • BarCodeGeneratorBase.CalcCheckSum

    Gets or sets whether to calculate a checksum for the bar code.

    Note

    A checksum of a Code 93 bar code can contain characters that are not supported by this bar code symbology. For this reason, the checksum is not included in the Code 93 bar code’s displayed text.

Examples

The following code creates a Code 93 bar code and specifies its main properties.

using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Windows.Forms;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...
public XRBarCode CreateCode93BarCode(string BarCodeText) {
    // Create a bar code control.
    XRBarCode barCode = new XRBarCode();

    // Set the bar code's type to Code 93.
    barCode.Symbology = new Code93Generator();

    // Adjust the bar code's main properties.
    barCode.Text = BarCodeText;
    barCode.Width = 400;
    barCode.Height = 100;

    // Adjust the properties specific to the bar code type.
    ((Code93Generator)barCode.Symbology).CalcCheckSum = false;

    return barCode;
}

To add the XRBarCode to a report band, handle the report’s XRControl.BeforePrint event.

using System.Drawing.Printing;
// ...

private void XtraReport1_BeforePrint(object sender, PrintEventArgs e) {
    this.Detail.Controls.Add(CreateCode93BarCode("012345678"));
}