Barcode Class
Represents a generated barcode as a boolean matrix of modules.
public sealed class BarcodeProperties
| Name | Description |
|---|---|
| Height | Gets the height (number of rows). |
| Text | Gets the human-readable interpretation of the barcode: the encoded data as it is printed under the bars. |
| Type | Gets the type of barcode. |
| Width | Gets the width (number of columns). |
Height
Barcode.csText
Barcode.csGets the human-readable interpretation of the barcode: the encoded data as it is printed under the bars.
public string Text { get; }Property value
Remarks
It includes the characters the barcode adds: the check digit of EAN-8, EAN-13 and UPC-A (followed by a space and the add-on when there is one), the Mod 43 check character of Code 39 when it is included, and the start and stop characters of Codabar. It does not include the Code 39 and Code 93 start and stop characters.
Type
Barcode.csWidth
Barcode.csIndexers
| Name | Description |
|---|---|
| this[int, int] | Gets whether the module at the specified position is dark. |
this[int, int]
Barcode.csMethods
| Name | Description |
|---|---|
| CreateCodabar(string, char, char) | Creates a Codabar barcode from the specified data. |
| CreateCode128(string) | Creates a Code 128 barcode from the specified data. |
| CreateCode39(string, bool) | Creates a Code 39 barcode from the specified data. |
| CreateCode93(string) | Creates a Code 93 barcode from the specified data. |
| CreateEan13(string, string?) | Creates an EAN-13 barcode from the specified data. |
| CreateEan8(string, string?) | Creates an EAN-8 barcode from the specified data. |
| CreateGs1128(ReadOnlySpan<Gs1Element>) | Creates a GS1-128 barcode from GS1 element strings. |
| CreateItf(string) | Creates an Interleaved 2 of 5 (ITF) barcode from the specified data. |
| CreateUpcA(string, string?) | Creates a UPC-A barcode from the specified data. |
CreateCodabar(string, char, char)
Barcode.csCreateCode128(string)
Barcode.csCreates a Code 128 barcode from the specified data.
Parameters
datastring- The data to encode: ASCII characters (U+0000 to U+007F), control characters included.
Returns
Barcode A new Barcode instance.
Remarks
The encoder chooses the code sets: C for runs of digits, A for control characters, B for lowercase letters, with a SHIFT when the other code set is needed for a single character.
CreateCode39(string, bool)
Barcode.csCreateCode93(string)
Barcode.csCreateEan13(string, string?)
Barcode.csCreates an EAN-13 barcode from the specified data.
CreateEan8(string, string?)
Barcode.csCreates an EAN-8 barcode from the specified data.
CreateGs1128(ReadOnlySpan<Gs1Element>)
Barcode.csCreates a GS1-128 barcode from GS1 element strings.
public static Barcode CreateGs1128(params scoped ReadOnlySpan<Gs1Element> elements)Parameters
elementsReadOnlySpan<Gs1Element>- The element strings, in the order they are encoded.
Returns
Barcode A new Barcode instance, whose Barcode.Text is the human-readable interpretation: each application identifier in parentheses, followed by its data.
Exceptions
ArgumentExceptionelementsis empty, containsnull, or needs more than the 48 data characters of a GS1-128 symbol (application identifiers and separators included).
Remarks
The symbol starts with the FNC1 function character that identifies GS1-128, and a FNC1 separator follows each element whose application identifier does not have a predefined length, except the last one. The parentheses of the human-readable interpretation are not encoded. A reader returns the data with the separators as the ASCII group separator character (U+001D) and the symbology identifier ]C1.
Put the elements of variable length last to save separators. Barcode.CreateCode128 never adds FNC1: the symbols it creates are not GS1-128 symbols, even when the data looks like element strings.
CreateItf(string)
Barcode.csCreateUpcA(string, string?)
Barcode.csCreates a UPC-A barcode from the specified data.