# NumPrinterPages Method

## Applies to

THtmlViewer, TFrameViewer, and TFrameBrowser components

## Declaration

function NumPrinterPages: integer; overload;

function NumPrinterPages(var WidthRatio: double): integer; overload;

## Description

This function returns the total number of pages which will be printed.

The optional WidthRatio parameter gives an indication if the print output will extend beyond the allowed width. If WidthRatio is 1.0, the entire print job will fil. If WidthRatio is 1.25, something in the print job will extend 25% beyond the allowed width. A WidthRatio value less than 1.0 will not occur.

WidthRatio may be used to set the PrintScale property to insure all printing will be within the margins using code similar to:

if WidthRatio > 1.0 then

Viewer.PrintScale := Viewer.PrintScale * WidthRatio;

Note: The NumPrinterPages function can be slow in some situations as it simulates the entire print job.

See also:

Print Method

PrintScale Property