Barcode2DConsoleRenderer Class

Provides methods to render a two-dimensional barcode (Data Matrix, PDF417, Aztec) using Unicode block characters.

public static class Barcode2DConsoleRenderer

Methods

NameDescription
ToConsoleString(Barcode2D, ConsoleRenderOptions?)Renders the barcode as a string using Unicode block characters, two rows of modules per line.
WriteTo(Barcode2D, TextWriter, ConsoleRenderOptions?)Renders the barcode to a TextWriter using Unicode block characters.
WriteToConsole(Barcode2D, ConsoleRenderOptions?)Renders the barcode to Console.Out.

ToConsoleString(Barcode2D, ConsoleRenderOptions?)

Barcode2DConsoleRenderer.cs

Renders the barcode as a string using Unicode block characters, two rows of modules per line.

public static string ToConsoleString(this Barcode2D barcode, ConsoleRenderOptions? options = null)

Parameters

barcode Barcode2D
The barcode to render.
options ConsoleRenderOptions?
The rendering options, or null for the defaults.

Returns

string The lines of the barcode, without trailing spaces and without a final new line.

Exceptions

ArgumentNullException
barcode is null.
ArgumentOutOfRangeException
An option is out of range, or the text is too large for a string.

WriteTo(Barcode2D, TextWriter, ConsoleRenderOptions?)

Barcode2DConsoleRenderer.cs

Renders the barcode to a TextWriter using Unicode block characters.

public static void WriteTo(this Barcode2D barcode, TextWriter writer, ConsoleRenderOptions? options = null)

Parameters

barcode Barcode2D
The barcode to render.
writer TextWriter
The destination.
options ConsoleRenderOptions?
The rendering options, or null for the defaults.

Exceptions

ArgumentNullException
barcode or writer is null.
ArgumentOutOfRangeException
An option is out of range, or the text is too large for a string.

WriteToConsole(Barcode2D, ConsoleRenderOptions?)

Barcode2DConsoleRenderer.cs

Renders the barcode to Console.Out.

public static void WriteToConsole(this Barcode2D barcode, ConsoleRenderOptions? options = null)

Parameters

barcode Barcode2D
The barcode to render.
options ConsoleRenderOptions?
The rendering options, or null for the defaults.

Exceptions

ArgumentNullException
barcode is null.
ArgumentOutOfRangeException
An option is out of range, or the text is too large for a string.