Instance Method

rectForPage:

Implemented by subclasses to determine the portion of the view to be printed for the specified page number.

Declaration

- (NSRect)rectForPage:(NSInteger)page;

Parameters

pageNumber

An integer indicating a page number. Page numbers are one-based—that is pages run from one to N.

Return Value

A rectangle defining the region of the view to be printed for pageNumber. This method returns NSZeroRect if pageNumber is outside the view’s bounds.

Discussion

If the view responded YES to an earlier knowsPageRange: message, this method is invoked for each page it specified in the out parameters of that message. The view is later made to display this rectangle in order to generate the image for this page.

If an NSView object responds NO to knowsPageRange:, this method isn’t invoked by the printing mechanism.

See Also

Pagination

heightAdjustLimit

The fraction of the page that can be pushed onto the next page during automatic pagination to prevent items such as lines of text from being divided across pages.

widthAdjustLimit

The fraction of the page that can be pushed onto the next page during automatic pagination to prevent items such as small images or text columns from being divided across pages.

- adjustPageWidthNew:left:right:limit:

Overridden by subclasses to adjust page width during automatic pagination.

- adjustPageHeightNew:top:bottom:limit:

Overridden by subclasses to adjust page height during automatic pagination.

- knowsPageRange:

Returns YES if the view handles page boundaries, NO otherwise.

- locationOfPrintRect:

Invoked by print: to determine the location of the region of the view being printed on the physical page.