Table of Contents

Class TwBarcodeService

Namespace
TwBlazor.Services
Assembly
TwBlazor.dll

The default ITwBarcodeService, built on the library's own barcode encoders.

public sealed class TwBarcodeService : ITwBarcodeService
Inheritance
TwBarcodeService
Implements
Inherited Members

Constructors

TwBarcodeService()

public TwBarcodeService()

Methods

Encode(string, BarcodeFormat)

Encodes a value as a barcode.

public Barcode Encode(string value, BarcodeFormat format = BarcodeFormat.Code128)

Parameters

value string

The value to encode.

format BarcodeFormat

The barcode format. Defaults to Code128.

Returns

Barcode

The encoded barcode.

Exceptions

ArgumentNullException

value is null.

SymbolEncodingException

The value cannot be encoded in format.

TryEncode(string?, BarcodeFormat, out Barcode?)

Tries to encode a value as a barcode, without throwing when the value does not suit the format.

public bool TryEncode(string? value, BarcodeFormat format, out Barcode? barcode)

Parameters

value string

The value to encode.

format BarcodeFormat

The barcode format.

barcode Barcode

The encoded barcode, or null when the value cannot be encoded.

Returns

bool

true when the value was encoded.