<< Click to Display Table of Contents >> Navigation: Programming > Printing and PDF Export > Label Priniting > Example Project > After changing sheet size and margins |
procedure TForm1.MargHorizontalChange(Sender: TObject);
begin
// UseInch ---- true: we work with inch, false: we work with CM
WPRichText1.RTFData.LabelDef.UnitIsInch := UseInch;
WPRichText1.RTFData.LabelDef.SheetWidth := SheetWidth.ValueAsInchOrCM(UseInch);
WPRichText1.RTFData.LabelDef.SheetHeight := SheetHeight.ValueAsInchOrCM(UseInch);
WPRichText1.RTFData.LabelDef.Top := MargTop.ValueAsInchOrCM(UseInch);
WPRichText1.RTFData.LabelDef.Left := MargLeft.ValueAsInchOrCM(UseInch);
WPRichText1.RTFData.LabelDef.Right := MargRight.ValueAsInchOrCM(UseInch);
WPRichText1.RTFData.LabelDef.Bottom := MargBottom.ValueAsInchOrCM(UseInch);
WPRichText1.RTFData.LabelDef.Horizontal := MargHorizontal.ValueAsInchOrCM(UseInch);
WPRichText1.RTFData.LabelDef.Vertical := MargVertical.ValueAsInchOrCM(UseInch);
// Read
LabelWidth.SetValueAsInchOrCM( WPRichText1.RTFData.LabelDef.LabelWidth, UseInch);
LabelHeight.SetValueAsInchOrCM( WPRichText1.RTFData.LabelDef.LabelHeight, UseInch);
StoreProps;
WPRichText1.ReformatAll(true, true);
end;