RadzenBarcodeEncoder Class

Provides 1D barcode encoding utilities for common symbologies.

Inheritance

Object

RadzenBarcodeEncoder

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public static class RadzenBarcodeEncoder

Methods

EncodeCodabarlink

Encodes a string into Codabar module widths.

Declaration
public static IReadOnlyList<int> EncodeCodabar(string value)
Parameters
Type Name Description
string value The value to encode.
Returns
Type Description
IReadOnlyList<int>The module widths (bar/space alternating, starting with bar).

EncodeCode128Blink

Encodes a string into Code 128 subset B module widths.

Declaration
public static IReadOnlyList<int> EncodeCode128B(string value)
Parameters
Type Name Description
string value The value to encode.
Returns
Type Description
IReadOnlyList<int>The module widths (bar/space alternating, starting with bar).

EncodeCode128Blink

Encodes a string into Code 128 subset B module widths.

Declaration
public static IReadOnlyList<int> EncodeCode128B(string value, Int32& checksum)
Parameters
Type Name Description
string value The value to encode.
Int32& checksum
Returns
Type Description
IReadOnlyList<int>The module widths (bar/space alternating, starting with bar).

EncodeCode39link

Encodes a string into Code 39 module widths.

Declaration
public static IReadOnlyList<int> EncodeCode39(string value)
Parameters
Type Name Description
string value The value to encode.
Returns
Type Description
IReadOnlyList<int>The module widths (bar/space alternating, starting with bar).

EncodeEan13link

Encodes a string into EAN-13 bit pattern.

Declaration
public static string EncodeEan13(string value, String& checksumText)
Parameters
Type Name Description
string value The value to encode.
String& checksumText The calculated checksum digit.
Returns
Type Description
stringThe bit pattern (1=bar, 0=space).

EncodeEan8link

Encodes a string into EAN-8 bit pattern.

Declaration
public static string EncodeEan8(string value, String& checksumText)
Parameters
Type Name Description
string value The value to encode.
String& checksumText The calculated checksum digit.
Returns
Type Description
stringThe bit pattern (1=bar, 0=space).

EncodeIsbnAsEan13link

Encodes an ISBN as EAN-13 bit pattern.

Declaration
public static string EncodeIsbnAsEan13(string value, String& checksumText)
Parameters
Type Name Description
string value The ISBN value to encode.
String& checksumText The calculated checksum digit.
Returns
Type Description
stringThe bit pattern (1=bar, 0=space).

EncodeIssnAsEan13link

Encodes an ISSN as EAN-13 bit pattern.

Declaration
public static string EncodeIssnAsEan13(string value, String& checksumText)
Parameters
Type Name Description
string value The ISSN value to encode.
String& checksumText The calculated checksum digit.
Returns
Type Description
stringThe bit pattern (1=bar, 0=space).

EncodeItflink

Encodes a string into ITF (Interleaved 2 of 5) module widths.

Declaration
public static IReadOnlyList<int> EncodeItf(string value)
Parameters
Type Name Description
string value The value to encode.
Returns
Type Description
IReadOnlyList<int>The module widths (bar/space alternating, starting with bar).

EncodeMsiPlesseylink

Encodes a value into MSI (Modified Plessey) bit pattern.

Declaration
public static string EncodeMsiPlessey(string value, String& checksumText)
Parameters
Type Name Description
string value The value to encode.
String& checksumText The calculated checksum digit.
Returns
Type Description
stringThe bit pattern (1=bar, 0=space).

EncodePharmacodelink

Encodes a Pharmacode value and returns the bar geometry.

Declaration
public static ValueTuple<IReadOnlyList<BarcodeRect>, double> EncodePharmacode(string value, double barHeight, int quietZone)
Parameters
Type Name Description
string value The Pharmacode numeric value.
double barHeight The bar height in SVG units.
int quietZone The quiet zone in modules.
Returns
Type Description
ValueTuple<IReadOnlyList<BarcodeRect>, double>The bar rectangles and viewBox width.

EncodePostnetlink

Encodes a POSTNET value and returns the bar geometry.

Declaration
public static ValueTuple<IReadOnlyList<BarcodeRect>, double> EncodePostnet(string value, double barHeight, int quietZone, String& checksumText)
Parameters
Type Name Description
string value The value to encode.
double barHeight The bar height in SVG units.
int quietZone The quiet zone in modules.
String& checksumText The calculated checksum digit.
Returns
Type Description
ValueTuple<IReadOnlyList<BarcodeRect>, double>The bar rectangles and viewBox width.

EncodeRm4scclink

Encodes a RM4SCC value and returns the bar geometry.

Declaration
public static ValueTuple<IReadOnlyList<BarcodeRect>, double> EncodeRm4scc(string value, double barHeight, int quietZone, String& checksumText)
Parameters
Type Name Description
string value The value to encode.
double barHeight The bar height in SVG units.
int quietZone The quiet zone in modules.
String& checksumText The calculated checksum character.
Returns
Type Description
ValueTuple<IReadOnlyList<BarcodeRect>, double>The bar rectangles and viewBox width.

EncodeTelepenlink

Encodes a string into Telepen module widths.

Declaration
public static IReadOnlyList<int> EncodeTelepen(string value, String& checksumText)
Parameters
Type Name Description
string value The value to encode.
String& checksumText The calculated checksum value.
Returns
Type Description
IReadOnlyList<int>The module widths (bar/space alternating, starting with bar).

EncodeUpcAlink

Encodes a string into UPC-A bit pattern.

Declaration
public static string EncodeUpcA(string value, String& checksumText)
Parameters
Type Name Description
string value The value to encode.
String& checksumText The calculated checksum digit.
Returns
Type Description
stringThe bit pattern (1=bar, 0=space).

ToSvglink

Encodes a barcode value and renders it into an SVG string.

Declaration
public static string ToSvg(RadzenBarcodeType type, string value, double barHeight, int quietZoneModules, string foreground, string background)
Parameters
Type Name Description
RadzenBarcodeType type The barcode type.
string value The value to encode.
double barHeight The bar height in SVG units.
int quietZoneModules The quiet zone in modules.
string foreground The bar color.
string background The background color.
Returns
Type Description
stringAn SVG string representing the barcode.
In This Article
An error has occurred. This app may no longer respond until reloaded. Reload 🗙