zplCore.comzplCore.com

LabelItem

public abstract class LabelItem

Base class for all label items. Positions are in the label's unit (or LabelItem.Unit).

Properties

PropertyTypeDescription
DataField { get; set; }stringData binding: field name in the record passed to Label.ToZpl.
DataFieldFormat { get; set; }string.NET format string applied to the bound value, e.g. "0000" or "dd.MM.yyyy". Without a culture it formats with the invariant culture; number formats also apply to bound text that is a number ("12.5").
Expression { get; set; }stringExpression that computes the item's text/code, e.g. Upper([Name]) + " " + Format(Today(), "dd.MM.yy"). Takes precedence over LabelItem.DataField. See ExpressionEngine.
Name { get; set; }string
PrintAsGraphic { get; set; }boolRender the item to a bitmap and send it as ^GFA graphic (any TTF font, exact preview match, works on printers without the font or element support).
Reverse { get; set; }boolInvert the item over what's below it (^FR).
RotationAngle { get; set; }doubleRotation in degrees clockwise (any angle; 0 = use the item's Rotation if it has one). Multiples of 90° use native ZPL orientation where the item supports it; other angles render the item as ^GFA graphic. The rotated item's bounding box starts at (LabelItem.X, LabelItem.Y).
Unit { get; set; }LabelUnit?Unit of this item's position and sizes (null = the label's unit).
Visible { get; set; }bool
X { get; set; }double
Y { get; set; }double

Methods

Method SignatureReturnsDescription
# Clone()LabelItemDeep copy (through the JSON model).
# ConvertToUnit(LabelUnit unit, LabelUnit labelUnit = LabelUnit.Mm, int dpi = 203)LabelItemConverts position and sizes to unit and sets LabelItem.Unit. labelUnit is the unit used while LabelItem.Unit is null; dpi matters for dots only.
# ToZpl(ZplContext ctx)string