< Previous PageNext Page > Hide TOC

Printing Features and Printing Dialog Panes

This chapter describes standard printing features, their relation to printing dialog panes, and the various ways of adding new panes to printing dialogs.

Throughout this chapter, the term “printing dialog” always refers specifically to the Page Setup and Print dialogs, which are introduced and discussed in detail in Mac OS X Printing System Overview.

Note: The illustrations of printing dialogs in this chapter are taken from Mac OS X version 10.1.

In this section:

Standard Sets of Printing Features
Printing Dialog Panes
Extending a Printing Dialog


Standard Sets of Printing Features

Apple has identified a number of printing features common to many printers and applications. For convenience, similiar features are organized into named sets, as listed in Table 1-1.

Table 1-1  Standard sets of printing features

Name

Features

Page Attributes

Formatting printer, paper size, orientation, scale

Copies & Pages

Copies per page, page range, collation

Layout

Page layout and border options

Duplex

Print on both sides, binding options

Output Options

Output to file in various formats

Paper Feed

Paper source tray selection

Error Handling

PostScript errors, tray switching

Printer Features

Features declared with PPD file keywords

Color Options

Color-matching system

Paper Type & Quality

Media types, paper quality levels

Each feature set has a corresponding set of parameters of various types. These parameters are used during the execution of a print job to control and refine the output.

The printing dialogs allow an application user to view and change control settings that represent the current values of these parameters. For example, Duplex is implemented in the Print dialog as shown in Figure 1-1.


Figure 1-1  Duplex pane in the Print dialog

Duplex pane in the Print dialog

Duplex has two parameters:

  1. Print on both sides (Boolean)

  2. Long-edge or short-edge binding (enumeration)

Note:  The second parameter is defined only if two-sided printing is selected. Printing parameters often depend on other parameters in important ways.

A checkbox control represents the Boolean parameter, and two button controls represent the binding choices. Both buttons are disabled unless the checkbox is selected.

Printing Dialog Panes

A pane is a rectangular region inside a dialog window, in which a set of related controls are displayed together. Printing dialogs present a list of available panes using a pop-up menu, and allow the user to choose one for display.

A pane has the following characteristics:

From a user’s perspective, all of the panes in a printing dialog look integrated and seem to have equal weight. The area allocated to each pane depends on its contents, and is limited only by the maximum width and height permitted by the printing system.

Standard and Custom Panes

The Apple-supplied printing dialog panes in Mac OS X are called standard panes. These panes implement standard sets of printing features, and give users a consistent interface as they switch between different applications and printers.

Table 1-2 lists the standard panes in Mac OS X. These panes implement most of the feature sets listed in Table 1-1.

Table 1-2  The standard panes in Mac OS X

Pane

Dialog

PostScript

Page Attributes

Page Setup

Copies & Pages

Print

Layout

Print

Duplex

Print

Output Options

Print

Paper Feed

Print

Y

Error Handling

Print

Y

Printer Features

Print

Y

Note: Three standard panes—Paper Feed, Error Handling, and Printer Features —implement features associated with PostScript printers. When the destination printer is a PostScript printer, these panes are available in the Print dialog.

Panes implemented by third-party application developers and printer vendors are called custom panes. Custom panes can implement standard feature sets found in Table 1-1, or custom printing features for a specific application or printer.

When a custom pane implements a standard feature set, the printing system uses the standard name to identify the pane. However, the printing system never modifies the appearance of the user interface inside a custom pane.

Examples

A pane’s dimensions are constrained by the maximum size of the dialog. The Page Setup and Print dialogs both display their panes in the central part of the window, but the two dialogs have different widths and layouts. To get a sense of where a pane appears in each dialog, it’s useful to view some examples.

Figure 1-2 shows two examples of panes in the Page Setup dialog. The shaded area indicates the actual pane rectangle.


Figure 1-2  Panes in the Page Setup dialog

Panes in the Page Setup dialog

Figure 1-3 shows two examples of panes in the Print dialog. The dialog surrounds the pane with a group box that is slightly larger than the pane—the shaded area indicates the actual pane rectangle.


Figure 1-3  Panes in the Print dialog

Panes in the Print dialog

The pane on the right probably looks unfamiliar—clearly it’s not a standard pane. This is a custom pane implemented with a printing dialog extension.

Extending a Printing Dialog

Adding a custom pane to a printing dialog is said to extend the dialog, because the pane—together with the software that implements it—adds functionality that goes beyond what Mac OS X provides.

What’s involved in extending a printing dialog?

At minimum, you need to

Appending Dialog Items in Carbon

While the practice is discouraged, Carbon applications that run in Mac OS X can still use the AppendDITL function to extend a printing dialog. This approach is fully documented in Tech Note 1080, “Adding Items to the Printing Manager’s Dialogs”.

The application provides callback functions to initialize the dialog, append new items to it, draw the items, handle user actions on the appended items, and so on. The printing system displays the added controls inside a new dialog pane that’s named for the application. The application can host only a single custom pane in each dialog.

Using the AppendDITL function is the only solution for application developers who want to maintain a common code base for Mac OS 9 and Mac OS X. In Mac OS X it has some drawbacks—for example, an application using this mechanism cannot display the dialog as a sheet.

Note:  Printer module developers cannot use the AppendDITL function to extend a printing dialog.

Accessory Views in Cocoa

A Cocoa application can extend the Print dialog by adding a custom NSView to an NSPrintPanel object, using the setAccessoryView method. The custom view is displayed when the user selects the application’s pane in the Print dialog. The printing system resizes the pane to accommodate the NSView you add.

In similiar fashion, a Cocoa application can extend the Page Setup dialog by adding a custom NSView to an NSPageLayout object.

For more information on how to add accessory views to printing dialogs in a Cocoa application, see Printing Programming Topics for Cocoa.

Printing Dialog Extensions

The printing dialog extension is a Mac OS X printing plug-in API that allows applications and printer modules to take advantage of advanced features in the printing system as they extend the printing dialogs. For a complete specification of this API, see Printing Plug-in Interfaces Reference.

Applications and printer modules can use printing dialog extensions to

Printer modules can also use printing dialog extensions to

It’s worth noting that Apple uses printing dialog extensions to implement almost all the standard panes. (The one exception is Summary, a special pane that contains information about other panes.)

Choosing the Best Solution

If you want to extend a printing dialog and you’re not sure how to proceed, here are some recommendations.

Cocoa applications should use the approach described in “Accessory Views in Cocoa.”

If your Carbon application runs in Mac OS X exclusively, the choice is easy—you should always use a printing dialog extension.

For Carbon applications that run in both Mac OS 9 and Mac OS X:



< Previous PageNext Page > Hide TOC


© 2002, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-10-03)


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.