On Mac OS X, Carbon applications can initiate multiple, simultaneous printing tasks. Each printing task is referred to as a session , and each printing session is independent of other printing sessions. Printing sessions can run in separate threads, or you can create multiple sessions within a single-threaded application.
Printing sessions are also supported on Mac OS 8 and 9, but each application can have only one printing session running in a single thread, due to limitations of the underlying Classic printing architecture.
To support printing sessions, the Carbon Printing Manager API is conceptually divided into three groups: session functions, non-session functions, and universal functions. Session functions allow you to create and manage printing sessions. These functions take a
PMPrintSession
parameter, which is an opaque object that uniquely identifies a particular printing session.
The non-session functions offer an alternative API that provides similar services, but does not support multithreading or simultaneous printing sessions. These functions closely mirror their Classic counterparts, and operate identically on all Carbon platforms, but they also inherit most of the limitations of the Classic Printing Manager. Apple therefore strongly recommends that you adopt the session functions instead.
You must not mix session and non-session functions within your application. The Carbon Printing Manager header files are designed to prevent this by using conditional macros to enable only one or the other. The session functions are enabled by default, but you can enable the non-session functions by adding the following statement to one of your source files before including the Carbon Printing Manager headers:
#define PM_USE_SESSION_APIS 0
The universal functions, such as page format and print settings accessors, are available whether you are using session or non-session functions.