|Top Previous Next|
Using the new property LabelDef which was added to WPTools 8 You can quickly print labels. It is also possible to preview the label sheets just like they would be printed. It is even possible to edit the text on the label sheets. You can also specify the label number to start with. All parameters of a label can be specified, using centimeter or inch values, depending on UnitIsInch.
A Label is either defined by the sheet size (width/height), column count, rowcount and the margins (top, bottom,left, right, horizontal and vertical)
by the sheet size (width/height), the top, left, right and bottom margin and the specified label width and label height.
Active : Switch Label display on / off
AsText : Retrieve and set the label definition as text
UnitIsInch : If true all floating point values are inch instead of centimeter (cm)
Bottom : Bottom Margin
Caption : Caption of the label, displayed over text
ColumnCount : Count of columns
Horizontal : Horizontal margin between columns
LabelHeight : Size of a label, if you set it you cannot change vertical margin and row count
LabelWidth : Size of a label, if you set it you cannot change horizontal margin and row count
Left : Left Margin
Name : Name of this label definition (encoded into "AsText")
Padding : Padding inside of the label
Right : Right Margin
RowCount : Count of rows
SheetHeight : Height of label sheet
SheetWidth : Width of label sheet
StartNr : Start nr for printing
Top : Top Margin
Vertical : Margin between rows
new: Caption and frame is not painted for empty labels.
New: When label printing is active, soft page breaks will be ignored.
You can switch on the old behavior with the format option wpfLabelAllowSoftPagebreakLabelprinting:
You can use the TWPValueEdit to build the userinterface.
This component implements the function ValueAsInchOrCM() to read the value as inch or cm.
So you can code as easy as
WPRichText1.RTFData.LabelDef.SheetWidth := SheetWidth.ValueAsInchOrCM(UseInch);
WPRichText1.RTFData.LabelDef.SheetHeight := SheetHeight.ValueAsInchOrCM(UseInch);