Provides 1D barcode encoding utilities for common symbologies.
Object
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public static class RadzenBarcodeEncoderEncodes a string into Codabar module widths.
public static IReadOnlyList<int> EncodeCodabar(string value)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| Type | Description |
|---|---|
| IReadOnlyList<int> | The module widths (bar/space alternating, starting with bar). |
Encodes a string into Code 128 subset B module widths.
public static IReadOnlyList<int> EncodeCode128B(string value)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| Type | Description |
|---|---|
| IReadOnlyList<int> | The module widths (bar/space alternating, starting with bar). |
Encodes a string into Code 128 subset B module widths.
public static IReadOnlyList<int> EncodeCode128B(string value, Int32& checksum)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| Int32& | checksum |
| Type | Description |
|---|---|
| IReadOnlyList<int> | The module widths (bar/space alternating, starting with bar). |
Encodes a string into Code 39 module widths.
public static IReadOnlyList<int> EncodeCode39(string value)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| Type | Description |
|---|---|
| IReadOnlyList<int> | The module widths (bar/space alternating, starting with bar). |
Encodes a string into EAN-13 bit pattern.
public static string EncodeEan13(string value, String& checksumText)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| String& | checksumText | The calculated checksum digit. |
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
Encodes a string into EAN-8 bit pattern.
public static string EncodeEan8(string value, String& checksumText)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| String& | checksumText | The calculated checksum digit. |
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
Encodes an ISBN as EAN-13 bit pattern.
public static string EncodeIsbnAsEan13(string value, String& checksumText)
| Type | Name | Description |
|---|---|---|
| string | value | The ISBN value to encode. |
| String& | checksumText | The calculated checksum digit. |
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
Encodes an ISSN as EAN-13 bit pattern.
public static string EncodeIssnAsEan13(string value, String& checksumText)
| Type | Name | Description |
|---|---|---|
| string | value | The ISSN value to encode. |
| String& | checksumText | The calculated checksum digit. |
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
Encodes a string into ITF (Interleaved 2 of 5) module widths.
public static IReadOnlyList<int> EncodeItf(string value)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| Type | Description |
|---|---|
| IReadOnlyList<int> | The module widths (bar/space alternating, starting with bar). |
Encodes a value into MSI (Modified Plessey) bit pattern.
public static string EncodeMsiPlessey(string value, String& checksumText)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| String& | checksumText | The calculated checksum digit. |
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
Encodes a Pharmacode value and returns the bar geometry.
public static ValueTuple<IReadOnlyList<BarcodeRect>, double> EncodePharmacode(string value, double barHeight, int quietZone)
| Type | Name | Description |
|---|---|---|
| string | value | The Pharmacode numeric value. |
| double | barHeight | The bar height in SVG units. |
| int | quietZone | The quiet zone in modules. |
| Type | Description |
|---|---|
| ValueTuple<IReadOnlyList<BarcodeRect>, double> | The bar rectangles and viewBox width. |
Encodes a POSTNET value and returns the bar geometry.
public static ValueTuple<IReadOnlyList<BarcodeRect>, double> EncodePostnet(string value, double barHeight, int quietZone, String& checksumText)
| 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. |
| Type | Description |
|---|---|
| ValueTuple<IReadOnlyList<BarcodeRect>, double> | The bar rectangles and viewBox width. |
Encodes a RM4SCC value and returns the bar geometry.
public static ValueTuple<IReadOnlyList<BarcodeRect>, double> EncodeRm4scc(string value, double barHeight, int quietZone, String& checksumText)
| 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. |
| Type | Description |
|---|---|
| ValueTuple<IReadOnlyList<BarcodeRect>, double> | The bar rectangles and viewBox width. |
Encodes a string into Telepen module widths.
public static IReadOnlyList<int> EncodeTelepen(string value, String& checksumText)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| String& | checksumText | The calculated checksum value. |
| Type | Description |
|---|---|
| IReadOnlyList<int> | The module widths (bar/space alternating, starting with bar). |
Encodes a string into UPC-A bit pattern.
public static string EncodeUpcA(string value, String& checksumText)
| Type | Name | Description |
|---|---|---|
| string | value | The value to encode. |
| String& | checksumText | The calculated checksum digit. |
| Type | Description |
|---|---|
| string | The bit pattern (1=bar, 0=space). |
Encodes a barcode value and renders it into an SVG string.
public static string ToSvg(RadzenBarcodeType type, string value, double barHeight, int quietZoneModules, string foreground, string background)
| 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. |
| Type | Description |
|---|---|
| string | An SVG string representing the barcode. |