Getting Started with Printing

Technology Overview

The Mac OS X printing system provides Macintosh developers with a flexible and powerful printing environment that uses Quartz 2D for rendering and conversion services. Quartz 2D supports a resolution-independent PDF drawing model. With this model, applications can print high-quality, color-managed output on all classes of raster and PostScript printers, and save documents as PDFs.

You can use the Mac OS X printing system in your application in numerous ways or extend it with software you create. Application developers can add printing support to their applications and application-specific features to the Page Setup or Print dialog. Printer vendors can write printer drivers to support their printers. They can also provide custom panes for the Print dialog to support printer-specific features.

Start Here

Before you begin to write any code, it’s a good idea to be familiar with the underlying technology of the printing system. If you haven’t already done so, read about Apple’s printing features. Then read Mac OS X Printing System Overview for a look under the hood at how printing is implemented in Mac OS X.

Choose a Learning Path

If you’re an application developer, you want users to print from your application or from the Finder. If your application is specialized for graphics or publication, you may want to provide users with other customized options. If you are a printer vendor, you want to make sure your printer and its unique features can be accessed from any application.

Supporting Printing in Your Application

You can support printing in your application whether you develop in procedural C, Objective-C, or BSD UNIX. You can also support printing of documents created by your application without users opening the application.

  • If you are using procedural C, see Supporting Printing in Your Carbon Application. You can find the functions that are discussed there in Carbon Printing Manager Reference. For helpful code, install the Xcode Tools CD and go to the folder /Developer/Examples/Printing/.

  • If you are using Objective-C, you support printing using Cocoa objects and methods. For an overview of printing in Cocoa, read Printing Programming Topics for Cocoa. For helpful sample code, install the Xcode Tools CD and go to the folder /Developer/Examples/AppKit/TextEdit/.

  • If you are using BSD UNIX, you can write a faceless application using functions and data types defined in the header files PMCore.h and PMDefinitions.h. To understand the items in the printing header files, refer to Carbon Printing Manager Reference. If you are interested in knowing the details of CUPS, obtain a copy of Michael R. Sweet’s book CUPS: Common UNIX Printing System.

  • If you want users to print documents created by your application without first opening the application, become familiar with Apple events, especially the Print Documents Apple event. To learn about the variety of printing settings that Mac OS X v 10.3 supports, read Technical Note TN2082, The Enhanced Print Apple Event. To understand Apple events and the AppleScript language, read AppleScript Overview. You can find functions that are discussed there in Apple Event Manager Reference.

Customizing Options in Printing Dialogs

You have the option to write a printing dialog extension to support application features that are not supported in the Apple-provided Page Setup and Print dialogs.

Supporting Printer Hardware

If you are a printer vendor, you’ll create a printer driver for each printer or family of printers to ensure the printers support Mac OS X. You’ll also provide a printing dialog extension so that users have access to the special features offered by your hardware, regardless of the application they print from.

Because of the specialized nature of printer driver development, Apple recommends reading Printing Plug-in Interfaces Reference, Extending Printing Dialogs, and Ticket Services Reference. Then contact Apple Developer Technical Support with your requirements before beginning development. You can contact developer support through developer.apple.com.

Next Steps

The Printing Reference Library includes the following high-level Printing resource pages, which you can bookmark for easy access:

  • Guides

    Conceptual and how-to information for printing.

  • Reference

    Focused, detailed descriptions in reference format for printing.

  • Sample Code

    Samples demonstrating how to use printing routines.

  • Technical Notes

    Late-breaking documents on printing issues

  • Technical Q&As

    Programming tips, code snippets, & FAQs by Apple’s support engineers.

  • Mailing Lists

    You can use the Printing mailing list to discuss any issues you encounter writing code.

Here are additional Printing resources that you should be aware of.



© 2004, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.