About Printing on the Mac
Explains how to support printing in Cocoa applications.
At a Glance
Most Cocoa apps provide printing support in one form or another. When you create a Cocoa app, the Print command is automatically provided in the File menu. It’s straightforward for apps to implement printing.
Printing is Designed to be Easy-to-Use and Flexible
The printing system does as much as possible automatically for your app. If your app’s printing needs are simple, you might need to write only a few lines of code. But if your app needs to print precisely formatted pages, you’ll find that OS X printing provides all the flexibility you need.
Relevant Chapter: Printing System Workflow and User Interface
NSView and NSDocument Objects Each Support Printing
The printing system API works in conjunction with the NSView and NSDocument classes. Each class has API that responds to print messages. Your app will either be view-based or document-based. Printing is easy to use in either type of app. The basic concepts are the same with only minor differences in the API available to each.
Relevant Chapter: Printing From Your App
Layout Options Let You Format for Paper
Most of the time you’ll want to print content other than what shows on the display, if only to add page numbers or margins. You can add borders, crop marks, and other features to the page as well as set up layout options that work best with paper.
Relevant Chapter: Laying Out Page Content
If it Needs to, Your App Can Manage the Printing Workflow
Most apps can let the printing system take care of managing Print and Page Setup panels, querying printers, and managing print information. If your app is not a typical app, you can manage various objects in the printing system. For example, your app can add an accessory view to the Print panel to allow users to set app-specific printing features.
Relevant Chapters: Managing and Extending the Print Panel , Managing Print Information Objects , and Managing Page Layout Objects
Next
Copyright © 2002, 2012 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2012-12-20