QRCodeGenerator.CompactionMode Property

Gets or sets whether numeric, alphanumeric or byte mode should be used to encode the barcode’s data.

Namespace: DevExpress.XtraPrinting.BarCode

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

Declaration

[DefaultValue(QRCodeCompactionMode.AlphaNumeric)]
public QRCodeCompactionMode CompactionMode { get; set; }

Property Value

Type Default Description
QRCodeCompactionMode

AlphaNumeric

A QRCodeCompactionMode enumeration value.

Available values:

Name Description
Numeric

Numeric data is encoded. Max. 7,089 characters.

AlphaNumeric

A combination of alphabetic and numeric characters is encoded. Max. 4,296 characters.

Byte

Binary data is encoded. Max. 2,953 bytes.

Remarks

If the data encoded in numeric or alphanumeric mode contains invalid characters for the QRCode barcode, switch to byte mode to interpret the data as a sequence of bytes and use this sequence to encode the barcode.

Set the barcode’s CompactionMode property to Byte to enable byte mode. To specify binary data to encode the barcode, do one of the following:

  • Transform the data into a sequence of bytes and assign the sequence to the barcode’s BinaryData property.
  • Assign the data to the barcode’s Text property to automatically use UTF-8 to convert the data into a sequence of bytes.
See Also