HtmlForgeX

API Reference

Class

EmailBarcode

Namespace HtmlForgeX.Email
Assembly HtmlForgeX.Email
Base Element
Implements
Modifiers sealed

Email-safe Code 128 barcode rendered as a single table row (no images/SVG/canvas). Designed to work in legacy clients (including Outlook) using only table markup.

Inheritance

Constructors

Methods

public override String ToString() #
Returns: String
public EmailBarcode WithAlignment(Alignment alignment) #
Returns: EmailBarcode

Sets alignment.

Parameters

alignment HtmlForgeX.Email.Alignment requiredposition: 0
public EmailBarcode WithAutoFit(Int32 maxWidthPx) #
Returns: EmailBarcode

Enables auto fitting by reducing module size to keep the barcode within max width.

Parameters

maxWidthPx System.Int32 requiredposition: 0
public EmailBarcode WithBorder(String color, String width = "1px", String radius = null) #
Returns: EmailBarcode

Sets an optional border around the barcode block.

Parameters

color System.String requiredposition: 0
width System.String = "1px" optionalposition: 1
radius System.String = null optionalposition: 2
public EmailBarcode WithColors(String bar, String background) #
Returns: EmailBarcode

Sets bar and background colors.

Parameters

bar System.String requiredposition: 0
background System.String requiredposition: 1
public EmailBarcode WithHeight(Int32 pixels) #
Returns: EmailBarcode

Sets bar height in pixels.

Parameters

pixels System.Int32 requiredposition: 0
public EmailBarcode WithModuleSize(Int32 pixels) #
Returns: EmailBarcode

Sets module size in pixels.

Parameters

pixels System.Int32 requiredposition: 0
public EmailBarcode WithQuietZone(Int32 modules) #
Returns: EmailBarcode

Sets quiet zone size in modules.

Parameters

modules System.Int32 requiredposition: 0
public EmailBarcode WithValue(String value) #
Returns: EmailBarcode

Sets the barcode value.

Parameters

value System.String requiredposition: 0
public EmailBarcode WithValueText(Boolean show = true, String text = null) #
Returns: EmailBarcode

Shows or hides the value text under the barcode.

Parameters

show System.Boolean = true optionalposition: 0
text System.String = null optionalposition: 1

Properties

public String Value { get; set; } #

Payload encoded into the barcode (ASCII 32-126 supported).

public Int32 ModuleSizePx { get; set; } #

Width of a single barcode module in pixels.

public Int32 HeightPx { get; set; } #

Height of the barcode bars in pixels.

public Int32 QuietZoneModules { get; set; } #

Quiet zone size in modules (space on each side).

public Int32 MaxWidthPx { get; set; } #

Optional max width (px). When set, module size is reduced (never increased) to fit.

public String BarColor { get; set; } #

Bar (foreground) color.

public String BackgroundColor { get; set; } #

Background (space) color.

public String BorderColor { get; set; } #

Optional border color around the barcode block (empty = none).

public String BorderWidth { get; set; } #

Optional border width (defaults to 1px when BorderColor is set).

public String BorderRadius { get; set; } #

Optional border radius around the barcode block.

public Alignment Alignment { get; set; } #

Alignment of the barcode block within its container.

public Boolean ShowValueText { get; set; } #

When true, renders the value (or ValueText) under the barcode.

public String ValueText { get; set; } #

Optional value text to render under the barcode (defaults to Value).

public String ValueTextColor { get; set; } #

Value text color (theme-aware by default).

public String ValueTextFontFamily { get; set; } #

Value text font family.

public String ValueTextFontSize { get; set; } #

Value text font size.

public String ValueTextFontWeight { get; set; } #

Value text font weight.

public Int32 ValueTextPaddingTopPx { get; set; } #

Top padding (px) above the value text when shown.