frameFits

frameFits(fr: Frame): Boolean updating;

The frameFits method of the Printer class returns true if the frame specified in the frame parameter can be fitted within the remaining height of the current printer page (the width is not checked), excluding the space taken by the current footer. An exception is raised if this method is invoked from a server method.

The code fragments in the following examples show the use of the frameFits method.

if not app.printer.frameFits(printForm.detail1) then
    timeTaken := (app.clock - startTime).Time;
    printForm.timeTaken1.caption := timeTaken.String;
    printForm.timeTaken2.caption := timeTaken.String;
    checkForHeaderSwap(printForm);
    startTime := app.clock;
    if cb_ChangeMargins.value then
        leftMargin.text := (leftMargin.text.Integer + 5).String;
        app.printer.leftMargin  := leftMargin.text.Integer;
        app.printer.rightMargin := rightMargin.text.Integer + 5;
    endif;
endif;

while app.printer.frameFits(printForm.fillerFrame) do
    result := app.printer.print(printForm.fillerFrame);
    if result <> 0 then
        break outerWhile;
    endif;
endwhile;