Printing in NSDocument-Based Applications

An NSDocument-based Cocoa application provides cover for more of the printing functionality, isolating the developer even further from direct NSPageLayout and NSPagePanel interaction.

Each NSDocument contains its own NSPrintInfo instance, which is accessible through the method -printInfo. The document’s NSPrintInfo instance can be set using the method -setPrintInfo: and passing the NSPrintInfo as the argument.

NOTE

Overriding -setPrintInfo: in an NSDocument subclass provides an opportunity to react to a user having changed the page orientation, scale, or page type. The subclass’s implementation of -setPrintInfo: can cause any views to redraw as required.

NSPageLayout Interaction

There are several

Get Cocoa® Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.