In This Article

Code39Symbology Class

Represents a barcode symbology implementation for Code 39.

public class Code39Symbology : LinearBarcodeSymbologyBase
Inheritance:
object ObservableObjectBase BarcodeSymbologyBase LinearBarcodeSymbologyBase object
Derived:
Code39ExtendedSymbology

Remarks

This symbology is also known as Alpha39, Code 39 mod 43, Code 3 of 9, Code 3/9, USD-3, and USS Code 39.

Code 39 is a linear symbology, and is one of the first alphanumeric barcodes. Each character encoded is made up of 5 bars and 4 spaces for a total of 9 elements. 3 out of the 9 element are always wide. Although it is not as dense of a symbology such as Code 128, it is one of the most widely supported symbologies by devices.

This symbology can encode numbers, uppercase letters, and -$% ./+ characters.

Each encoded value must start and stop with *, which is automatically inserted. The AreStartStopCharactersVisible property determines whether these start/stop characters are included in the displayed value.

This symbology is self-checking, so no checksum or check digit is required. However if the IsChecksumEnabled property is true, the symbology's implementation auto-calculates and inserts a check digit. This is referred to as Code 39 mod 43.

An extended implementation of Code 39 is available in Code39ExtendedSymbology. That implementation allows for all lower 128 ASCII characters to be encoded based on the core Code 39 concepts.

Constructors

Code39Symbology()

Initializes an instance of the class.

public Code39Symbology()

Properties

AreStartStopCharactersVisible

Indicates whether the start/stop characters (*) are visible in the displayed value.

public bool AreStartStopCharactersVisible { get; set; }

Property Value

bool:

The default value is false.

ExampleValue

An example value that is valid for the symbology.

public override string ExampleValue { get; }

Property Value

string

IsChecksumEnabled

Indicates whether the optional checksum should be added.

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.0.

Methods

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.

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.

PreprocessCharacter(char)

Preprocesses a raw input value character before encoding, such as converting lowercase to uppercase, escaping characters, etc.

protected virtual string PreprocessCharacter(char ch)
Parameter Type Description
ch char

A raw input value character.

Returns

string:

The preprocessed string value to encode.

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