In This Article

Interleaved2of5Symbology Class

Represents a barcode symbology implementation for Interleaved 2 of 5 (ITF).

public class Interleaved2of5Symbology : LinearBarcodeSymbologyBase
Inheritance:
object ObservableObjectBase BarcodeSymbologyBase LinearBarcodeSymbologyBase object
Derived:
Itf14Symbology

Remarks

This symbology is also known as ITF, ANSI/AIM BC2-1995, and USS Interleaved 2 of 5.

Interleaved 2 of 5 is a high-density, numeric-only linear symbology that encodes digit pairs. The first digit of each pair is encoded in the bars, and the second digit is encoded in the interleaved spaces. Each digit is represented by 5 elements (2 wide and 3 narrow), hence the name "2 of 5".

This symbology can only encode digits 0-9. Since digits are encoded in pairs, the value must contain an even number of digits. A leading 0 is automatically prepended when the value has an odd number of digits.

This symbology is commonly used in warehouse distribution, the ITF-14 variant for shipping containers, and on film and photofinishing equipment.

This symbology is not self-checking. If the IsChecksumEnabled property is true, the symbology's implementation auto-calculates and appends a modulo-10 check digit.

An ITF-14 implementation is available in Itf14Symbology.

Constructors

Interleaved2of5Symbology()

Initializes an instance of the class.

public Interleaved2of5Symbology()

Properties

AreAllDigitsVisible

Indicates whether all digits are visible in the displayed value.

protected virtual bool AreAllDigitsVisible { get; }

Property Value

bool:

The default value is false.

BearerBarKind

The kind of bearer bars to render around the barcode.

public Interleaved2of5BearerBarKind BearerBarKind { get; set; }

Property Value

Interleaved2of5BearerBarKind:

The default value is None.

Remarks

Bearer bars are thick bars placed around the barcode to help prevent misreads. When bearer bars are enabled, they are rendered in the quiet zone area and the encoder automatically outputs sufficient horizontal quiet zone spacing.

BearerBarWidth

The width of the bearer bars, in module-width units.

public double BearerBarWidth { get; set; }

Property Value

double:

The default value is 4.0.

Remarks

This value is only used when BearerBarKind is not None. The GS1 specification recommends bearer bars be at least 2.5 to 3.0 times the narrow bar width.

ExampleValue

An example value that is valid for the symbology.

public override string ExampleValue { get; }

Property Value

string

IsChecksumEnabled

Indicates whether the optional modulo-10 checksum digit should be appended.

public bool IsChecksumEnabled { get; set; }

Property Value

bool:

The default value is false.

Name

The name of the symbology.

public override string Name { get; }

Property Value

string

WideToNarrowRatio

The ratio of wide bars to narrow bars.

public double WideToNarrowRatio { get; set; }

Property Value

double:

The default value is 2.5.

Methods

CalculateChecksumDigit(string)

Calculates a check digit for the given value.

protected virtual char CalculateChecksumDigit(string value)
Parameter Type Description
value string

The value for which to calculate the checksum digit.

Returns

char:

The calculated checksum digit, or character value '\0' if no checksum should be used.

Remarks

The default implementation uses the standard GS1 modulo-10 algorithm. Derived symbologies may override this to implement different checksum algorithms as needed.

CreateRenderData(BarcodeEncodingRequest)

Creates the render data for the specified encoding request.

public override BarcodeRenderData CreateRenderData(BarcodeEncodingRequest request)
Parameter Type Description
request BarcodeEncodingRequest

The encoding request.

Returns

BarcodeRenderData:

The BarcodeRenderData for the encoded value.

GetMargin()

Returns the margin thickness to apply around the barcode, which is typically used to provide a quiet zone for better scanning reliability.

public override Thickness GetMargin()

Returns

Thickness:

The margin Avalonia.Thickness, which is generally the value of the QuietZoneThickness property.

GetModulesWidth(int)

Returns the width of the specified number of modules.

protected override double GetModulesWidth(int moduleCount)
Parameter Type Description
moduleCount int

The number of modules.

Returns

double:

The calculated width, taking into account any adjustments such as wide-to-narrow ratios that a symbology may require.

Validate(string)

Validates the specified value.

public override BarcodeValidationResult Validate(string value)
Parameter Type Description
value string

The value to validate.

Returns

BarcodeValidationResult:

A BarcodeValidationResult containing the validation result.

Inherited Members

Extension Methods