Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
To help you achieve great results that address all your printing needs, Cocoa offers a collection of important classes for printing in Mac OS X. You use these classes together to add printing to your applications:
NSView: Printing to a page is as simple as drawing text and graphics in an NSView. The examples in this chapter build on the graphics example in Chapter 12.
NSPageLayout: This class is responsible for displaying the Page Setup panel. Typically applications display this panel when a user chooses FilePage Setup. Your users will invoke the Page Setup panel to choose the orientation of the printed page. They can also set the paper size in the Page Setup panel. When the user has finished adjusting the printing properties of the NSPageLayout object, the NSPageLayoutObject saves the results in an NSPrintInfo object.
NSPrintInfo: NSPrintInfo is a storage class that holds the settings and options for printing. NSPrintInfo stores the settings from the Page Setup panel as well as the page count, margins, and other items that appear in the NSPrintPanel.
NSPrintPanel: When you choose FilePrint from most applications, you see an example of the NSPrintPanel. The NSPrintPanel is responsible for managing the settings of a print job. NSPrintPanel stores its settings in an NSPrintInfo object.
NSPrintOperation: This class takes care of creating the printed page. It displays the Print panel and carries out the print job.