Instance Method

adjustPageWidthNew:left:right:limit:

Overridden by subclasses to adjust page width during automatic pagination.

Declaration

- (void)adjustPageWidthNew:(CGFloat *)newRight left:(CGFloat)oldLeft right:(CGFloat)oldRight limit:(CGFloat)rightLimit;

Parameters

newRight

Returns by indirection a new float value for the right edge of the pending page rectangle in the view's coordinate system.

left

A float value that sets the left edge of the pending page rectangle in the view’s coordinate system.

proposedRight

A float value that sets the right edge of the pending page rectangle in the view’s coordinate system.

rightLimit

The leftmost float value newRight can be set to, as calculated using the value of the widthAdjustLimit property.

Discussion

This method is invoked by print:. The view can pull in the right edge and return the new value in newRight, allowing it to prevent items such as small images or text columns from being divided across pages. If rightLimit is exceeded, the pagination mechanism simply uses rightLimit for the right edge.

The default implementation of this method propagates the message to its subviews, allowing nested views to adjust page width for their drawing as well. An NSButton object or other small view, for example, will nudge the right edge out if necessary to prevent itself from being cut in two (thereby pushing it onto an adjacent page). Subclasses should invoke super’s implementation, if desired, after first making their own adjustments.

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.

- 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.

- rectForPage:

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

- locationOfPrintRect:

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