Table of Contents

Class LinearBarcode

Namespace
MiPdf.Barcodes
Assembly
MiPdf.dll

A one-dimensional barcode (Code 128, EAN, Code 39, ...): a sequence of bars and spaces.

public class LinearBarcode : Barcode
Inheritance
LinearBarcode
Derived
Inherited Members

Properties

Font

Font of the human-readable text (default Helvetica).

public PdfFont Font { get; set; }

Property Value

PdfFont

FontSize

Font size of the human-readable text; default: proportional to the module width.

public double? FontSize { get; set; }

Property Value

double?

HumanReadableText

The text printed below the bars.

public string HumanReadableText { get; }

Property Value

string

Modules

Bars (true) and spaces (false), one entry per module.

public IReadOnlyList<bool> Modules { get; }

Property Value

IReadOnlyList<bool>

ShowText

Print the human-readable text below the bars (default true).

public bool ShowText { get; set; }

Property Value

bool

TotalWidthModules

Total width in modules: the number of Modules plus the quiet zone on both sides.

public override int TotalWidthModules { get; }

Property Value

int

Methods

Draw(PdfCanvas, double, double, double, double)

Draws the bars stretched to the rectangle with the bottom-left corner (x, y); the module width is width / TotalWidthModules. If ShowText is set, the human-readable text is drawn at the bottom of the rectangle, below the bars.

public override void Draw(PdfCanvas canvas, double x, double y, double width, double height)

Parameters

canvas PdfCanvas
x double
y double
width double
height double

ToString()

Returns the modules as text ('|' bar, ' ' space).

public override string ToString()

Returns

string