Instance Property

numberOfPages

The number of pages to render.

Declaration

var numberOfPages: Int { get }

Discussion

By default, returns the number of pages as calculated by UIKit if the receiver uses print formatters. If the page renderer uses no print formatters, the returned value is zero. If your page renderer is doing any custom drawing except for headers and footers, it must override this method.

This method is called at any point when UIKit needs the number of pages. If an application requests the page range control, it's called early on. It can also be called when the selected printer or duplex mode changes. Otherwise, it is called when the print job starts.

If print formatters aren’t used to compute the page count, the page renderer can override this method to calculate and return the number of pages. The computation can take into account the current printableRect value for each page, any implicit margins, and the content to be drawn when laid out within these boundaries.

See Also

Accessing Information About the Print Job

var paperRect: CGRect

The size of the paper used for printing.

var printableRect: CGRect

The area in which printing can occur.