Provides an interface to build a label set.
Namespace:
DYMO.Label.FrameworkAssembly: DYMO.Label.Framework (in DYMO.Label.Framework.dll) Version: 1.0.0.0 (8.4.0.1475)
Syntax
| C# |
|---|
public interface ILabelSetBuilder |
| Visual Basic (Declaration) |
|---|
Public Interface ILabelSetBuilder |
| Visual C++ |
|---|
public interface class ILabelSetBuilder |
Remarks
ILabelSetBuilder provides a way to populate a label set.
A label set is similar to a database record set and is designed to simplify/unify printing of multiple labels.
Each label set contains a collection of label records. Each label record contains the data to print on a single label.
Each label record contains data for one or more label objects. Usually the data is text or address data, but the data can also be image data.
Image data is specified as a base64-encoded png stream, see AddImage.
Text data can be specified as a plain string without any formatting (see AddText)
or as a styled (formatted) string containing font, font size, font size information per character basis.
Text formatting can be specified using method calls (see AddStyledText)
or using XML (see AddTextMarkup).
Examples
The following example prints three labels by populating three records in a label set. The output is as follows:



CopyC#



public void PrintWithLabelSet() { // open a label ILabel label = Label.Open("TextLabel.label"); // create a builder object to populate label set ILabelSetBuilder labelSetBuilder = new LabelSetBuilder(); // label #1 - use font specified in the label file ILabelRecordBuilder record = labelSetBuilder.AddRecord(); record.AddText("TEXT", "6x7=42"); // label #2 - specify font programmatically using StyledTextBuilder record = labelSetBuilder.AddRecord(); IStyledTextBuilder styledTextBuilder = new StyledTextBuilder(); styledTextBuilder.Append(new StyledTextBlock("6x7=", new FontInfo("Courier New", 36, FontStyle.None), Colors.Black)); styledTextBuilder.Append(new StyledTextBlock("42", new FontInfo("Courier New", 36, FontStyle.Bold), Colors.Black)); record.AddStyledText("TEXT", styledTextBuilder.StyledText); // label #3 - specify font using a markup string record = labelSetBuilder.AddRecord(); record.AddTextMarkup("TEXT", @"<font family='Courier New' size='36'>6x7=<b>42</b></font>"); label.Print("DYMO LabelWriter 450 Turbo", null, labelSetBuilder.Xml); }