Class RadzenBarcodeEncoder
Provides 1D barcode encoding utilities for common symbologies.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public static class RadzenBarcodeEncoder
Methods
EncodeCodabar(string)
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). |
EncodeCode128B(string)
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). |
EncodeCode128B(string, out int)
Encodes a string into Code 128 subset B module widths and returns the checksum.
Declaration
public static IReadOnlyList<int> EncodeCode128B(string value, out int checksum)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| int | checksum | The calculated checksum value. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<int> | The module widths (bar/space alternating, starting with bar). |
EncodeCode39(string)
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). |
EncodeEan13(string, out string)
Encodes a string into EAN-13 bit pattern.
Declaration
public static string EncodeEan13(string value, out string checksumText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| string | checksumText | The calculated checksum digit. |
Returns
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
EncodeEan8(string, out string)
Encodes a string into EAN-8 bit pattern.
Declaration
public static string EncodeEan8(string value, out string checksumText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| string | checksumText | The calculated checksum digit. |
Returns
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
EncodeIsbnAsEan13(string, out string)
Encodes an ISBN as EAN-13 bit pattern.
Declaration
public static string EncodeIsbnAsEan13(string value, out string checksumText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The ISBN value to encode. |
| string | checksumText | The calculated checksum digit. |
Returns
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
EncodeIssnAsEan13(string, out string)
Encodes an ISSN as EAN-13 bit pattern.
Declaration
public static string EncodeIssnAsEan13(string value, out string checksumText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The ISSN value to encode. |
| string | checksumText | The calculated checksum digit. |
Returns
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
EncodeItf(string)
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). |
EncodeMsiPlessey(string, out string)
Encodes a value into MSI (Modified Plessey) bit pattern.
Declaration
public static string EncodeMsiPlessey(string value, out string checksumText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| string | checksumText | The calculated checksum digit. |
Returns
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
EncodePharmacode(string, double, int)
Encodes a Pharmacode value and returns the bar geometry.
Declaration
public static (IReadOnlyList<BarcodeRect> bars, double vbWidth) 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 |
|---|---|
| (IReadOnlyList<BarcodeRect> bars, double vbWidth) | The bar rectangles and viewBox width. |
EncodePostnet(string, double, int, out string)
Encodes a POSTNET value and returns the bar geometry.
Declaration
public static (IReadOnlyList<BarcodeRect> bars, double vbWidth) EncodePostnet(string value, double barHeight, int quietZone, out 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 |
|---|---|
| (IReadOnlyList<BarcodeRect> bars, double vbWidth) | The bar rectangles and viewBox width. |
EncodeRm4scc(string, double, int, out string)
Encodes a RM4SCC value and returns the bar geometry.
Declaration
public static (IReadOnlyList<BarcodeRect> bars, double vbWidth) EncodeRm4scc(string value, double barHeight, int quietZone, out 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 |
|---|---|
| (IReadOnlyList<BarcodeRect> bars, double vbWidth) | The bar rectangles and viewBox width. |
EncodeTelepen(string, out string)
Encodes a string into Telepen module widths.
Declaration
public static IReadOnlyList<int> EncodeTelepen(string value, out 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). |
EncodeUpcA(string, out string)
Encodes a string into UPC-A bit pattern.
Declaration
public static string EncodeUpcA(string value, out string checksumText)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| string | checksumText | The calculated checksum digit. |
Returns
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
ToSvg(RadzenBarcodeType, string, double, int, string, string)
Encodes a barcode value and renders it into an SVG string.
Declaration
public static string ToSvg(RadzenBarcodeType type, string value, double barHeight = 50, int quietZoneModules = 10, string foreground = "#000000", string background = "#FFFFFF")
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 |
|---|---|
| string | An SVG string representing the barcode. |