setMargins

setMargins(orient: Integer;
           top:    Real;
           bottom: Real;
           left:   Real;
           right:  Real): Integer updating;

The setMargins method of the Printer class combines the settings of the properties for:

You can change the margins at any time, but the top and right margins take effect only at the start of the next page of output.

An exception is raised if this method is invoked from a server method.

The following example shows the use of the setMargins method.

bPrint_click(button: Button);
vars
    printer : Printer;
begin
    create printer transient;
    printer.setMargins(Print_Landscape, 25, 25, 25, 25);
    if graphFolder.topSheet = bgFrame then
        printer.printActive(bgFrame);
    else
        printer.printActive(lgFrame);
    endif;
epilog
    printer.close;
    delete printer;
end;

The orient parameter is the first to be specified, with a value of Print_Portrait (1) or Print_Landscape (2). The subsequent parameters for the setMargins method are specified in millimeters.

The setMargins method always returns zero (0).