Table of Contents

Class EanUpcOptions

Namespace
Egami.Barcodes
Assembly
Egami.Barcodes.dll
public sealed record EanUpcOptions : IEquatable<EanUpcOptions>
Inheritance
EanUpcOptions
Implements
Inherited Members

Examples

// A book: the ISBN as EAN-13, its check digit added, and the price as an EAN-5 add-on.
Barcode book = Barcode.Ean13("978020137962", new EanUpcOptions { AddOn = "52495" });

// Fitted into a rectangle, with the digits between the guard bars.
using Raster<Rgba8> label = Raster.Create(400, 200, Rgba8.White);
using (RasterCanvas<Rgba8> canvas = label.CreateCanvas())
{
    canvas.DrawBarcode(book, new RectF(10, 10, 380, 180), Rgba8.Black, new BarcodeDrawOptions { Font = font });
}

// A UPC-A number written in its short UPC-E form.
Barcode small = Barcode.UpcE("042100005264");

Properties

AddOn

Gets an add-on of 2 digits (EAN-2, such as a magazine's issue) or 5 digits (EAN-5, such as a book's price), drawn to the right of the main symbol with its digits above it; or null, the default, for none.

public string? AddOn { get; init; }

Property Value

string

Exceptions

ArgumentException

The value is not 2 or 5 digits.

Default

Gets the defaults.

public static EanUpcOptions Default { get; }

Property Value

EanUpcOptions

Height

Gets the height of the bars in modules, or null, the default, for the standard's nominal height: 69 for EAN-13, UPC-A and UPC-E, 55 for EAN-8. It sets the height when the barcode is drawn at a module size; drawn into a rectangle, the bars fill it.

public int? Height { get; init; }

Property Value

int?

Exceptions

ArgumentOutOfRangeException

The value is not positive.