A function identified as deprecated has been superseded and may become unsupported in the future.
Disposes of a universal procedure pointer (UPP) to an idle callback. (Deprecated in Mac OS X v10.4. There is no replacement; this function was included to facilitate porting legacy applications to Mac OS X, but it serves no useful purpose.)
void DisposePMIdleUPP ( PMIdleUPP userUPP );
You do not need this function in Mac OS X. Instead, use the standard idle proc. See the PMIdleProcPtr
callback function.
PMCoreDeprecated.h
Calls an idle callback. (Deprecated in Mac OS X v10.4. There is no replacement; this function was included to facilitate porting legacy applications to Mac OS X, but it serves no useful purpose.)
void InvokePMIdleUPP ( PMIdleUPP userUPP );
You do not need this function in Mac OS X. Instead, use the standard idle proc. See the PMIdleProcPtr
callback function.
PMCoreDeprecated.h
Creates a new universal procedure pointer (UPP) to an idle callback. (Deprecated in Mac OS X v10.4. There is no replacement; this function was included to facilitate porting legacy applications to Mac OS X, but it serves no useful purpose.)
PMIdleUPP NewPMIdleUPP ( PMIdleProcPtr userRoutine );
You do not need this function in Mac OS X. Instead, use the standard idle proc. See the PMIdleProcPtr
callback function.
PMCoreDeprecated.h
Prepares Core Printing for use. (Deprecated in Mac OS X v10.4. Use PMCreateSession
instead.)
OSStatus PMBegin ();
A result code. See “Core Printing Result Codes.”
Do not nest calls to PMBegin
.
PMCoreDeprecated.h
Creates a new PMPageFormat
object and a new PMPrintSettings
object from a print record created by the classic Printing Manager. (Deprecated in Mac OS X v10.4. There is no replacement; during the transition from Mac OS 9 to Mac OS X, this function facilitated the migration of print records saved in documents created in Mac OS 9, but the function no longer serves any useful purpose in Mac OS X.)
OSStatus PMConvertOldPrintRecord ( Handle printRecordHandle, PMPrintSettings *printSettings, PMPageFormat *pageFormat );
A handle to a print record created by the classic Printing Manager.
On return, a validated PMPrintSettings
object.
On return, a validated PMPageFormat
object.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
.
PMCoreDeprecated.h
Assigns default parameter values to an existing PMPageFormat
object, for the current printer. (Deprecated in Mac OS X v10.4. Use PMSessionDefaultPageFormat
instead.)
OSStatus PMDefaultPageFormat ( PMPageFormat pageFormat );
On return, a PMPageFormat
object containing default parameter values.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a page format object.
PMCoreDeprecated.h
Assigns default parameter values to a PMPrintSettings
object. (Deprecated in Mac OS X v10.4. Use PMSessionDefaultPrintSettings
instead.)
OSStatus PMDefaultPrintSettings ( PMPrintSettings printSettings );
A PMPrintSettings
object. On return, the object contains default parameter values.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a print settings object.
PMCoreDeprecated.h
Disables ColorSync color matching for the current page. (Deprecated in Mac OS X v10.4. There is no replacement; draw using Quartz 2D instead.)
OSStatus PMDisableColorSync ();
A result code. See “Core Printing Result Codes.”
Valid between calls to PMBeginPage
and PMEndPage
.
PMCoreDeprecated.h
Releases memory previously allocated for a PMPageFormat
object. (Deprecated in Mac OS X v10.4. Use PMRelease
instead.)
OSStatus PMDisposePageFormat ( PMPageFormat pageFormat );
On return, an invalidated PMPageFormat
object.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a page format object.
PMCoreDeprecated.h
Releases memory previously allocated for a PMPrintSettings
object. (Deprecated in Mac OS X v10.4. Use PMRelease
instead.)
OSStatus PMDisposePrintSettings ( PMPrintSettings printSettings );
On return, an invalidated PMPrintSettings
reference.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a print settings object.
PMCoreDeprecated.h
Enables ColorSync color matching for the current page. (Deprecated in Mac OS X v10.4. There is no replacement; draw using Quartz 2D instead.)
OSStatus PMEnableColorSync ();
A result code. See “Core Printing Result Codes.”
Valid between calls to PMBeginPage
and PMEndPage
.
PMCoreDeprecated.h
Closes Core Printing and releases its allocated memory. (Deprecated in Mac OS X v10.4. Use PMRelease
to release a PMPrintSession
object instead.)
OSStatus PMEnd (void);
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Obtains the result code from the last printing function called by your application. (Deprecated in Mac OS X v10.4. Use PMSessionError
instead.)
OSStatus PMError ();
A result code. The result code kPMCancel
indicates the user canceled the current print job.
Valid after calling PMBegin
.
PMCoreDeprecated.h
Maintains compatibility with the PrGeneral
function in the classic Printing Manager. (Deprecated in Mac OS X v10.4. Use PMPrinterGetCommInfo
instead.)
OSStatus PMGeneral ( Ptr pData );
A pointer to a PrGeneral
data structure.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
.
PMCoreDeprecated.h
Obtains the color mode for the print job. (Deprecated in Mac OS X v10.4. There is no replacement; this function was included to facilitate porting legacy applications to Mac OS X, but it serves no useful purpose.)
OSStatus PMGetColorMode ( PMPrintSettings printSettings, PMColorMode *colorMode );
The print settings object whose color mode you want to obtain.
On return, a pointer to a value that represents the color mode setting. See “Color Modes” for a list of possible return values.
A result code. See “Core Printing Result Codes.”
This function is not recommended. It doesn’t do anything in Mac OS X and in general is no longer appropriate for applications to call.
PMCoreDeprecated.h
Obtains the creator of the driver associated with the current printer. (Deprecated in Mac OS X v10.4. Use PMPrinterGetDriverCreator
instead.)
OSStatus PMGetDriverCreator ( OSType *creator );
On return, the 4-byte creator type of the driver (for example, 'APPL'
for an Apple printer driver).
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
.
PMCoreDeprecated.h
Obtains release information for the driver associated with the current printer. (Deprecated in Mac OS X v10.4. Use PMPrinterGetDriverReleaseInfo
instead.)
OSStatus PMGetDriverReleaseInfo ( VersRec *release );
On return, a pointer to a VersRec
data structure containing the driver’s short and long version strings and country code.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
.
PMCoreDeprecated.h
Obtains the printing port from an opaque printing context. (Deprecated in Mac OS X v10.4. Use PMSessionGetCGGraphicsContext
instead.)
OSStatus PMGetGrafPtr ( PMPrintContext printContext, GrafPtr *grafPort );
A PMPrintContext
object.
On return, a pointer to a grafPort
defining the current printing port.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a printing context.
PMCoreDeprecated.h
Obtains a resolution setting based on an index into the range of settings supported by the current printer. (Deprecated in Mac OS X v10.4. Use PMPrinterGetIndexedPrinterResolution
instead.)
OSStatus PMGetIndexedPrinterResolution ( UInt32 index, PMResolution *res );
An index into the range of resolution settings supported by the specified printer. Index values begin at 1.
On return, the printer resolution setting.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
. You must first use the PMGetPrinterResolutionCount
function to obtain the number of resolution settings supported by the current printer.
PMCoreDeprecated.h
Obtains the name of the print job. (Deprecated in Mac OS X v10.4. Use PMPrintSettingsGetJobName
instead.)
OSStatus PMGetJobName ( PMPrintSettings printSettings, StringPtr name );
A PMPrintSettings
object.
On return, the name of the print job.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a print settings object. Before using this function you must call PMValidatePrintSettings
to ensure that the print settings object is valid.
PMCoreDeprecated.h
Obtains information about the current printer’s imaging language. (Deprecated in Mac OS X v10.4. Use PMPrinterGetLanguageInfo
instead.)
OSStatus PMGetLanguageInfo ( PMLanguageInfo *info );
On return, a pointer to a data structure containing the printer’s language level, version and release. The format of the returned data is based on the PostScript language.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
. PMGetLanguageInfo
is useful for PostScript printers but may be irrelevant for other types of printers.
PMCoreDeprecated.h
Obtains the size of the imageable area in points, unaffected by rotation, resolution, or scaling. (Deprecated in Mac OS X v10.4. Use PMGetUnadjustedPageRect
or examine the paper returned by PMGetPageFormatPaper
.)
OSStatus PMGetPhysicalPageSize ( PMPageFormat pageFormat, PMRect *pageSize );
A PMPageFormat
object previously created by your application.
On return, a rectangle describing the physical page size where your application can draw.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Obtains the size of the paper in points, unaffected by rotation, resolution, or scaling. (Deprecated in Mac OS X v10.4. Use PMGetUnadjustedPaperRect
or examine the paper returned by PMGetPageFormatPaper
.)
OSStatus PMGetPhysicalPaperSize ( PMPageFormat pageFormat, PMRect *paperSize );
A PMPageFormat
object previously created by your application.
On return, a rectangle describing the physical size of the paper. Units are in 1/72 inch. Thus a 8.5 x 11 sheet of paper returns for its individual components:
top - 0.0
left - 0.0
bottom - 792.0
right - 612.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Obtains the resolution setting for the current printer according to the tag parameter. (Deprecated in Mac OS X v10.4. Use PMPrinterGetPrinterResolutionCount
and PMPrinterGetIndexedPrinterResolution
to examine the available printer resolutions.)
OSStatus PMGetPrinterResolution ( PMTag tag, PMResolution *res );
Specifies the kind of resolution information required.
The printer resolution setting.
A result code. . The result code kPMNotImplemented
indicates that the printer driver does not support multiple resolution settings.
Valid after calling PMBegin
.
The following resolution tag constants are recognized:
kPMMinRange
The minimum resolution supported by the printer.
kPMMaxRange
The maximum resolution supported by the printer.
kPMMinSquareResolution
The minimum resolution setting for which the horizontal and vertical resolutions are equal.
kPMMaxSquareResolution
The maximum resolution setting for which the horizontal and vertical resolutions are equal.
kPMDefaultResolution
The default resolution setting for the printer (typically 72 dpi).
PMCoreDeprecated.h
Obtains the number of resolution settings supported by the current printer. (Deprecated in Mac OS X v10.4. Use PMPrinterGetPrinterResolutionCount
instead.)
OSStatus PMGetPrinterResolutionCount ( UInt32 *count );
On return, the number of supported printing resolutions.
A result code. The result code kPMNotImplemented
indicates that the printer driver does not support multiple resolution settings.
Valid after calling PMBegin
.
PMCoreDeprecated.h
Reports whether the current printer driver supports the PostScript language. (Deprecated in Mac OS X v10.4. Use PMPrinterIsPostScriptCapable
or PMPrinterIsPostScriptPrinter
instead.)
OSStatus PMIsPostScriptDriver ( Boolean *isPostScript );
Returns true
if the current printer driver supports PostScript.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
. In Mac OS X, PMIsPostScriptDriver
always returns false
.
PMCoreDeprecated.h
Creates an old-style print record from a PMPageFormat
and a PMPrintSettings
object. (Deprecated in Mac OS X v10.4. There is no replacement; old-style print records are obsolete and serve no useful purpose in Mac OS X.)
OSStatus PMMakeOldPrintRecord ( PMPrintSettings printSettings, PMPageFormat pageFormat, Handle *printRecordHandle );
A PMPrintSettings
object.
A PMPageFormat
object.
On return, a handle to a an old-style print record. Your application must dispose of this handle.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a page format and print settings object. Use PMMakeOldPrintRecord
to create a print record to store with your documents for compatibility with pre-Carbon versions of your application. Note that because the page format and print settings objects contain more information than the old-style print record, some settings may be lost in conversion.
PMCoreDeprecated.h
Creates a new PMPageFormat
object. (Deprecated in Mac OS X v10.4. Use PMCreatePageFormat
instead.)
OSStatus PMNewPageFormat ( PMPageFormat *pageFormat );
On return, an initialized PMPageFormat
object.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
. The function PMNewPageFormat
allocates memory for a new PMPageFormat
object in your application’s memory space. The new page format object is empty until you set its values, or until you call PMDefaultPageFormat
or PMValidatePageFormat
.
PMCoreDeprecated.h
Creates a new PMPrintSettings
object. (Deprecated in Mac OS X v10.4. Use PMCreatePrintSettings
instead.)
OSStatus PMNewPrintSettings ( PMPrintSettings *printSettings );
On return, an initialized PMPrintSettings
object.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
. The function PMNewPrintSettings
allocates memory for a new PMPrintSettings
object in your application’s memory space. The new print settings object is empty until you set its values, or until you call PMDefaultPrintSettings
or PMValidatePrintSettings
.
PMCoreDeprecated.h
Puts the current driver into PostScript mode, ready to accept PostScript data instead of QuickDraw data. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMPostScriptBegin ();
A result code. See “Core Printing Result Codes.”
Valid between calls to PMBeginPage
and PMEndPage
. Call PMIsPostScriptDriver
before calling PMPostScriptBegin
to ensure that the current driver supports PostScript data.
PMCoreDeprecated.h
Passes PostScript data, referenced by a pointer, to the current printer driver. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMPostScriptData ( Ptr psPtr, Size len );
A pointer to PostScript data.
The number of bytes of PostScript data to pass to the current driver.
A result code. See “Core Printing Result Codes.”
Valid between calls to PMPostScriptBegin
and PMPostScriptEnd
.
PMCoreDeprecated.h
Restores the current driver to QuickDraw mode, ready to accept QuickDraw data instead of PostScript data. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMPostScriptEnd ();
A result code. See “Core Printing Result Codes.”
Valid between calls to PMBeginPage
and PMEndPage
. Call PMPostScriptEnd
to complete a PostScript session started with PMPostScriptBegin
.
PMCoreDeprecated.h
Passes PostScript data, contained in a file, to the current printer driver. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMPostScriptFile ( FSSpec *psFile );
A file specification.
A result code. See “Core Printing Result Codes.”
Valid between calls to PMPostScriptBegin
and PMPostScriptEnd
.
PMCoreDeprecated.h
Passes PostScript data, referenced by a handle, to the current printer driver. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMPostScriptHandle ( Handle psHandle );
A reference to PostScript data.
A result code. See “Core Printing Result Codes.”
Valid between calls to PMPostScriptBegin
and PMPostScriptEnd
.
PMCoreDeprecated.h
Obtains a reference to the specified printer’s description file. (Deprecated in Mac OS X v10.4. Use PMPrinterCopyDescriptionURL
instead.)
OSStatus PMPrinterGetDescriptionURL ( PMPrinter printer, CFStringRef descriptionType, CFURLRef *fileURL );
The printer whose description file you want to obtain.
A Core Foundation string that specifies the type of description file for the selected printer. Currently, there is only one type defined—kPMPPDDescriptionType
.
A pointer to your CFURLRef
variable. On return, the variable refers to a URL for the printer’s description file. In spite of the name, the function PMPrinterGetDescriptionURL
has Create/Copy semantics which means the caller must release the returned URL if it is not NULL
and the result code noErr
is returned.
A result code. See “Core Printing Result Codes.”
You can use this function to obtain a reference to the PostScript printer description (PPD) file for a PostScript printer.
PMCoreDeprecated.h
Obtains a copy of a printer's device URI. (Deprecated in Mac OS X v10.4. Use PMPrinterCopyDeviceURI
instead.)
OSStatus PMPrinterGetDeviceURI ( PMPrinter printer, CFURLRef *deviceURI );
The printer whose device URI you want to obtain.
A pointer to your CFURLRef
variable. On return, the variable refers to a URI for the location of the printer device. In spite of the name, this function has Create/Copy semantics which means the caller must release the returned URL if it is not NULL
and the result code noErr
is returned.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Creates new page format and print settings objects from an old-style print record created for the classic Printing Manager. (Deprecated in Mac OS X v10.4. There is no replacement; during the transition from Mac OS 9 to Mac OS X, this function facilitated the migration of print records saved in documents created in Mac OS 9, but the function no longer serves any useful purpose in Mac OS X.)
OSStatus PMSessionConvertOldPrintRecord ( PMPrintSession printSession, Handle printRecordHandle, PMPrintSettings *printSettings, PMPageFormat *pageFormat );
The current printing session.
A handle to an old-style print record created by the classic Printing Manager. You are responsible for disposing of the handle.
On return, a print settings object that contains values converted from the print record. You are responsible for releasing the print settings object with the function PMRelease
.
On return, a page format object that contains values converted from the print record. You are responsible for releasing the page format object with the function PMRelease
.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
.
You can use PMSessionConvertOldPrintRecord
to create page format and print settings objects from old-style print records stored in documents created by pre-Carbon versions of your application. You should validate the page format and print settings objects returned to you by calling the functions PMSessionValidatePageFormat
and PMSessionValidatePrintSettings
. Note that perfect translation between the old and new style objects is not achievable.
In Mac OS X, the function assumes the print record to be converted is a LaserWriter 8 print record.
If you need to convert a Mac OS 9 print record into data you can use in Mac OS X, you should extract the page size data from the print record and use the function PMCreatePageFormatWithPMPaper
to create a PMPageFormat
object that corresponds to that data.
PMCoreDeprecated.h
Maintains compatibility with the PrGeneral
function in the classic Printing Manager. (Deprecated in Mac OS X v10.4. Use PMPrinterGetCommInfo
instead.)
OSStatus PMSessionGeneral ( PMPrintSession printSession, Ptr pData );
The printing session whose data you want to obtain.
A pointer to a PrGeneral
data structure.
A result code. See “Core Printing Result Codes.”
The function PMSessionGeneral
is valid for the printing session passed to the function. In Mac OS X, the function PMSessionGeneral
makes an attempt to get the requested data if the opcode is getPSInfoOp
. Otherwise the result code kPMNotImplemented
is returned.
For more information about using the function PMSessionGeneral
, see Supporting Printing in Your Carbon Application.
PMCoreDeprecated.h
Obtains the spool file formats that can be generated for the specified printing session. (Deprecated in Mac OS X v10.4. If you’re drawing using Quartz 2D instead of QuickDraw, use PMSessionBeginCGDocument
or PMSessionBeginCGDocumentNoDialog
; for submitting PostScript data, use PMPrinterPrintWithFile
or PMPrinterPrintWithProvider
; to draw EPS data, use PMCGImageCreateWithEPSDataProvider
.)
OSStatus PMSessionGetDocumentFormatGeneration ( PMPrintSession printSession, CFArrayRef *docFormats );
The printing session whose spool file formats you want to obtain.
A pointer to your CFArrayRef
variable. On return, the variable refers to a Core Foundation array that contains the MIME types for the available spool file formats. Each element in the array is a Core Foundation string. Despite what its name implies, the function PMSessionGetDocumentFormatGeneration
has Create/Copy semantics which means you are responsible for releasing the array.
A result code. See “Core Printing Result Codes.”
You must call the function PMSessionGetDocumentFormatGeneration
between the creation and release of a printing session. See the function PMCreateSession
. You should call PMSessionGetDocumentFormatGeneration
only after the Print dialog is dismissed.
The function PMSessionGetDocumentFormatGeneration
determines the spool file formats that the specific print job supports. Spool file formats are represented by MIME types. The Mac OS X print spooler supports PDF and PICT + PS. The default spool file format is PDF. PICT + PS is supported only for printing to a PostScript printer.
The PICT + PS spool file format is not available on Intel-based systems.
PMCoreDeprecated.h
Obtains the spool file formats that are accepted by the current printer driver. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMSessionGetDocumentFormatSupported ( PMPrintSession printSession, CFArrayRef *docFormats, UInt32 limit );
The current printing session.
On return, an array of CFString
values containing MIME types specifying the spool file formats supported by the current printer driver. See “Document Format Strings” for a description of possible return values.
The maximum number of supported document formats to be returned.
A result code. See “Core Printing Result Codes.”
Valid within the context of a printing session.
Spool file formats are represented by MIME types. In Mac OS X, printer modules may support a wide range of spool file formats. The first item in the list of supported spool file formats is the default for the current printer driver.
PMCoreDeprecated.h
Reports whether the current printer driver supports a specified spool file format. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMSessionIsDocumentFormatSupported ( PMPrintSession printSession, CFStringRef docFormat, Boolean *supported );
The current printing session.
A spool file format represented by a MIME type.
Returns true
if the spool file format is supported by the current printer driver.
A result code. See “Core Printing Result Codes.”
Valid within the context of a printing session.
PMCoreDeprecated.h
Creates an old-style print record from page format and print settings objects. (Deprecated in Mac OS X v10.4. There is no replacement; old-style print records are obsolete and serve no useful purpose in Mac OS X.)
OSStatus PMSessionMakeOldPrintRecord ( PMPrintSession printSession, PMPrintSettings printSettings, PMPageFormat pageFormat, Handle *printRecordHandle );
The current printing session.
A print settings object. To create a print settings object you can call the function PMCreatePrintSettings
and then call the function PMSessionDefaultPrintSettings
to initialize the print settings object to default values.
A page format object. To create a page format object you can call the function PMCreatePageFormat
and then call the function PMSessionDefaultPageFormat
to initialize the page format object to default values.
On return, a handle to an old-style print record. You are responsible for disposing of the handle.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
.
You can use PMSessionMakeOldPrintRecord
to create an old-style print record to store with your documents for compatibility with pre-Carbon versions of your application. Note that because the page format and print settings objects contain more information than the old print record, some settings may be lost in the conversion. That is, perfect translation between the old and new style objects is not achievable.
In Mac OS X, the function always creates a LaserWriter 8 compatible print record.
The proper way to keep page format information for use in Mac OS X is with a flattened PMPageFormat
object. Typically applications don't keep print settings with a document but if that is appropriate for a given application, the proper way to do so is to use a flattened PMPrintSettings
object.
PMCoreDeprecated.h
Puts the current printer driver into PostScript mode, ready to accept PostScript data instead of QuickDraw data. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMSessionPostScriptBegin ( PMPrintSession printSession );
The current printing session.
A result code. See “Core Printing Result Codes.”
You must call the function PMSessionPostScriptBegin
between the creation and release of a printing session. See the function PMCreateSession
. You must also call the function within the scope of the functions PMSessionBeginPage
and PMSessionEndPage
.
To ensure that the current printer driver supports PostScript data, call PMSessionGetDocumentFormatGeneration
before you call the function PMSessionPostScriptBegin
. Check the list of supported spool file formats. If PICT + PS is one of them, select that format by calling the function PMSessionSetDocumentFormatGeneration
. The function PMSessionSetDocumentFormatGeneration
must be called before you call PMSessionBeginDocument
.
The function PMSessionPostScriptBegin
is not useful unless the current port is the printing port. The function returns true
if the document format is not PICT + PS.
The PICT + PS spool file format is not available on Intel-based systems.
PMCoreDeprecated.h
Passes PostScript data, referenced by a pointer, to the current printer driver. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMSessionPostScriptData ( PMPrintSession printSession, Ptr psPtr, Size len );
The current printing session.
A pointer to the PostScript data you want to pass to the current printer driver.
The number of bytes of PostScript data.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. Typically you call this function with the scope of calls to the functions PMSessionPostScriptBegin
and PMSessionPostScriptEnd
.
The function PMSessionPostScriptData
is not useful unless the current port is the printing port and the document format is PICT + PS.
The PICT + PS spool file format is not available on Intel-based systems.
PMCoreDeprecated.h
Restores the current driver to QuickDraw mode, ready to accept QuickDraw data instead of PostScript data. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMSessionPostScriptEnd ( PMPrintSession printSession );
The current printing session.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. You must also call this function with the scope of calls to the functions PMSessionBeginPage
and PMSessionEndPage
.
You call the function PMSessionPostScriptEnd
to complete a PostScript block started with PMSessionPostScriptBegin
. The function PMSessionPostScriptEnd
is not useful unless the current port is the printing port and the document format is PICT + PS.
The PICT + PS spool file format is not available on Intel-based systems.
PMCoreDeprecated.h
Passes the PostScript data, contained in a file, to the current printer driver. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMSessionPostScriptFile ( PMPrintSession printSession, FSSpec *psFile );
The current printing session.
A pointer to a variable that specifies a file location. The file should contain the PostScript data you want to pass to the current printer driver.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. You typically call this function within the scope of calls to the function PMSessionPostScriptBegin
and PMSessionPostScriptEnd
.
The function PMSessionPostScriptFile
is not useful unless the current port is the printing port and the document format is PICT + PS.
The PICT + PS spool file format is not available on Intel-based systems.
PMCoreDeprecated.h
Passes the PostScript data, referenced by a Memory Manager handle, to the current printer driver. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
, PMPrinterPrintWithProvider
, or PMCGImageCreateWithEPSDataProvider
instead.)
OSStatus PMSessionPostScriptHandle ( PMPrintSession printSession, Handle psHandle );
The current printing session.
A handle to the PostScript data you want to pass to the current printer driver. You must make sure the handle is of the appropriate size for the data, otherwise you risk corrupting the spool file.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. You must also call this function within the scope of calls to the function PMSessionPostScriptBegin
and PMSessionPostScriptEnd
.
The function PMSessionPostScriptEnd
is not useful unless the current port is the printing port and the document format is PICT + PS.
The PICT + PS spool file format is not available on Intel-based systems.
PMCoreDeprecated.h
Changes the current printer for a printing session to a printer specified by name. (Deprecated in Mac OS X v10.4. Use PMSessionSetCurrentPMPrinter
instead.)
OSStatus PMSessionSetCurrentPrinter ( PMPrintSession session, CFStringRef printerName );
The printing session whose printer you want to change.
The name of the printer you want to set as the current printer.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
.
PMCoreDeprecated.h
Requests a specified spool file format and supplies the graphics context type to use for drawing pages within the print loop. (Deprecated in Mac OS X v10.4. If you’re drawing using Quartz 2D instead of QuickDraw, use PMSessionBeginCGDocument
or PMSessionBeginCGDocumentNoDialog
; for submitting PostScript data, use PMPrinterPrintWithFile
or PMPrinterPrintWithProvider
; to draw EPS data, use PMCGImageCreateWithEPSDataProvider
.)
OSStatus PMSessionSetDocumentFormatGeneration ( PMPrintSession printSession, CFStringRef docFormat, CFArrayRef graphicsContextTypes, CFTypeRef options );
The printing session whose spool file format and graphics context type you want to specify.
A Core Foundation string that specifies the desired spool file format as a MIME type. See “Document Format Strings” for a description of the constants you can use to specify the document format.
A reference to a Core Foundation array of graphics contexts to use for drawing pages within the print loop. You can supply a QuickDraw graphics context (kPMGraphicsContextQuickDraw
) or a Quartz 2D graphics context (kPMGraphicsContextCoreGraphics
). An array of length 1 is the only length that is supported, regardless of graphics context type. See “Graphics Context Types” for a description of the constants you can use to specify a graphics context.
Reserved for future use.
A result code. See “Core Printing Result Codes.”
You only need to call the function PMSessionSetDocumentFormatGeneration
if you want to specify a format other than the default format (PDF) or a graphics context other than the default context (QuickDraw). If you want to use the default format for the operating system and to draw with QuickDraw, then you do not need to call this function. If you want to generate PICT + PS to use as one of the supported formats, then call PMSessionSetDocumentFormatGeneration
to set the graphics context to QuickDraw and the format to PICT + PS. Note that the PICT + PS format is not available on Intel-based systems.
If you want to use a Quartz 2D graphics context to draw each page, you can call the following code to inform the printing system in all versions of Mac OS X.
static OSStatus MyPMSessionBeginCGDocument ( |
PMPrintSession printSession, |
PMPrintSettings printSettings, |
PMPageFormat pageFormat) |
{ |
OSStatus err = noErr; |
// Use the simpler call if it is present. |
if(&PMSessionBeginCGDocument != NULL) { |
err = PMSessionBeginCGDocument (printSession, printSettings, pageFormat); |
} |
else { |
CFStringRef s[1] = { kPMGraphicsContextCoreGraphics }; |
CFArrayRef graphicsContextsArray = CFArrayCreate ( |
kCFAllocatorDefault, (const void**)s, 1, &kCFTypeArrayCallBacks); |
err = PMSessionSetDocumentFormatGeneration ( |
printSession, kPMDocumentFormatPDF, graphicsContextsArray, NULL); |
CFRelease (graphicsContextsArray); |
if(!err) |
err = PMSessionBeginDocument ( |
printSession, printSettings, pageFormat); |
} |
return err; |
} |
The previous code informs the printing system that you want a Quartz graphics context, but you get the actual context for your printing port only after you call the function PMSessionBeginPage
and then call the following code.
static OSStatus MyPMSessionGetCGGraphicsContext ( |
PMPrintSession printSession, |
CGContextRef *printingContextP) |
{ |
OSStatus err = noErr; |
// Use the simpler call if it is present. |
if(&PMSessionGetCGGraphicsContext != NULL) { |
err = PMSessionGetCGGraphicsContext (printSession, printingContextP); |
} |
else { |
err = PMSessionGetGraphicsContext ( |
printSession, kPMGraphicsContextCoreGraphics, |
(void**)printingContextP); |
} |
return err; |
} |
The printing context you get is a Quartz context into which you can draw. Note that the default coordinate system for Quartz 2D is not the same as that used for QuickDraw. Quartz 2D defines the coordinates of the lower-left corner of the sheet as (0,0) whereas the origin for the QuickDraw port is the upper-left corner of the imageable area.
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. You must call the function PMSessionSetDocumentFormatGeneration
before you call PMSessionBeginDocument
or PMSessionBeginDocumentNoDialog
. Before requesting a spool file format using this function, you should call the function PMSessionGetDocumentFormatGeneration
to get the list of supported formats.
The PICT + PS spool file format is not available on Intel-based systems.
PMCoreDeprecated.h
Installs an idle callback function in your print loop. (Deprecated in Mac OS X v10.4. There is no replacement; this function was included to facilitate porting legacy applications to Mac OS X, but it serves no useful purpose.)
OSStatus PMSessionSetIdleProc ( PMPrintSession printSession, PMIdleUPP idleProc );
The printing session that provides a context for the print job.
A universal procedure pointer to your idle function. Your idle function is defined by the callback PMIdleProcPtr
.
A result code. See “Core Printing Result Codes.”
You do not need this function in Mac OS X. Instead, use the standard idle proc.
PMCoreDeprecated.h
Specifies a set of PostScript code injection points and the PostScript data to be injected. (Deprecated in Mac OS X v10.4. Use PMPrinterPrintWithFile
or PMPrinterPrintWithProvider
instead.)
OSStatus PMSessionSetPSInjectionData ( PMPrintSession printSession, PMPrintSettings printSettings, CFArrayRef injectionDictArray );
The current printing session.
The print settings object in which to place the specified injection points.
A reference to a Core Foundation array that contains one or more Core Foundation dictionary (CFDictionary
) entries. Each dictionary entry specifies PostScript injection data you want inserted at a specific point in the print stream. See “PostScript Injection Dictionary Keys” for a description of the constants you can use as keys for these dictionary entries.
A result code. See “Core Printing Result Codes.” The result code kPMInvalidParameter
is returned if the injectionDictArray
object contains any invalid entries. The result code kPMInvalidPrintSession
is returned if the document format has not been set to kPMDocumentFormatPICTPS
for the specified printing session.
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. Before calling PMSessionSetPSInjectionData
, your application must set the document format of the printing session to kPMDocumentFormatPICTPS
using the function PMSessionSetDocumentFormatGeneration
.
For applications that require extensive control over PostScript code generation, the function PMSessionSetPSInjectionData
provides the ability to insert PostScript code into specified places in the print stream. It is intended for use by desktop publishing applications for which functions such as PMSessionPostScriptData
do not provide sufficient control.
You specify the injection points by creating an array of CFDictionary
entries. Each dictionary consists of key-value pairs in which the key specifies where to inject the PostScript and the value specifies the PostScript data you want to inject. The function verifies that the injectionDictArray
parameter is properly formed, and returns the kPMInvalidParameter
result code if the array does not contain valid entries.
If you call the function PMSessionSetPSInjectionData
a second time for a given print settings object, the injection points you specified previously are replaced with the new injection points.
PMCoreDeprecated.h
Sets the desired color mode for the print job. (Deprecated in Mac OS X v10.4. There is no replacement; this function was included to facilitate porting legacy applications to Mac OS X, but it serves no useful purpose.)
OSStatus PMSetColorMode ( PMPrintSettings printSettings, PMColorMode colorMode );
The print settings object whose color mode you want to set.
The desired color mode. See “Color Modes” for a list of possible values.
A result code. See “Core Printing Result Codes.”
This function does nothing in Mac OS X.
PMCoreDeprecated.h
Sets the value of the current result code. (Deprecated in Mac OS X v10.4. Use PMSessionSetError
instead.)
OSStatus PMSetError ( OSStatus printError );
The result code you wish to set. This result code will be returned by the PMError
function.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
.
PMCoreDeprecated.h
Installs an idle callback function in your print loop. (Deprecated in Mac OS X v10.4. There is no replacement; this function was included to facilitate porting legacy applications to Mac OS X, but it serves no useful purpose.)
OSStatus PMSetIdleProc ( PMIdleUPP idleProc );
A universal procedure pointer to your idle function. Your idle function is defined by the callback PMIdleProcPtr
.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
. The printing system calls your idle function periodically during your print loop.
Your idle function is not called in Mac OS X. It’s only called in Mac OS 8 and 9.
PMCoreDeprecated.h
Specifies the name of the print job. (Deprecated in Mac OS X v10.4. Use PMPrintSettingsSetJobName
instead.)
OSStatus PMSetJobName ( PMPrintSettings printSettings, StringPtr name );
A PMPrintSettings
object.
The name to assign to the print job. This string will be used to name the spool file.
A result code. The result code kPMInvalidParameter
is returned if you attempt to set the job name to an invalid file name or a null string.
Valid after calling PMBegin
and creating a print settings object.
PMCoreDeprecated.h
Requests a particular paper size, unaffected by rotation, resolution, or scaling. (Deprecated in Mac OS X v10.4. Use PMCreatePageFormatWithPMPaper
instead.)
OSStatus PMSetPhysicalPaperSize ( PMPageFormat pageFormat, const PMRect *paperSize );
The PMPageFormat
which will hold the new physical paper size.
The desired paper size expressed as a PMRect
. The units are 1/72 inch. A PMRect
is a rectangle whose individual components are doubles.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Obtains a valid PMPageFormat
object. (Deprecated in Mac OS X v10.4. Use PMSessionValidatePageFormat
instead.)
OSStatus PMValidatePageFormat ( PMPageFormat pageFormat, Boolean *result );
A PMPageFormat
object to be validated.
Returns true
if any parameters were changed, false
if no changes were required.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a page format object.
PMCoreDeprecated.h
Obtains a valid PMPrintSettings
object. (Deprecated in Mac OS X v10.4. Use PMSessionValidatePrintSettings
instead.)
OSStatus PMValidatePrintSettings ( PMPrintSettings printSettings, Boolean *result );
The PMPrintSettings
object to be validated.
On return, a value of true
if any parameters were changed, or false
if no changes were required.
A result code. See “Core Printing Result Codes.”
Valid after calling PMBegin
and creating a print settings object.
PMCoreDeprecated.h
Flattens a page format object into a Memory Manager handle for storage in a user document. (Deprecated in Mac OS X v10.5. Use PMPageFormatCreateDataRepresentation
instead.)
OSStatus PMFlattenPageFormat ( PMPageFormat pageFormat, Handle *flatFormat );
The page format object to flatten.
A pointer to your Handle
variable. On return, the variable refers to a Memory Manager handle that contains the flattened page format object. The handle is allocated by the function. You are responsible for disposing of the handle.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Flattens a page format object into a Core Foundation data object for storage in a user document. (Deprecated in Mac OS X v10.5. Use PMPageFormatCreateDataRepresentation
instead.)
OSStatus PMFlattenPageFormatToCFData ( PMPageFormat pageFormat, CFDataRef *flatFormat );
The page format object to flatten.
A pointer to your CFDataRef
variable. On return, the variable refers to a Core Foundation data object containing a flattened representation of the specified page format object. You are responsible for releasing the data object.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Flattens a page format object into a file for storage in a user document. (Deprecated in Mac OS X v10.5. Use PMPageFormatCreateDataRepresentation
and write the resulting data to your destination.)
OSStatus PMFlattenPageFormatToURL ( PMPageFormat pageFormat, CFURLRef flattenFileURL );
The page format object to flatten.
A Core Foundation URL specifying a file to contain a flattened representation of the specified page format object. If the file already exists, it is overwritten. Only file-based URLs are supported.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Flattens a print settings object into a Memory Manager handle for storage in a user document. (Deprecated in Mac OS X v10.5. Use PMPrintSettingsCreateDataRepresentation
instead.)
OSStatus PMFlattenPrintSettings ( PMPrintSettings printSettings, Handle *flatSettings );
The print settings object to flatten.
A pointer to your Handle
variable. On return, the variable refers to a Memory Manager handle that contains a flattened print settings object. The handle is allocated by the function. You are responsible for disposing of the handle.
A result code. See “Core Printing Result Codes.”
There are no scoping requirements as to when you may use this function.
Apple recommends that you do not reuse the print settings information if the user prints the document again. The information supplied by the user in the Print dialog should pertain to the document only while the document prints, so there is no need to save the print settings object.
PMCoreDeprecated.h
Flattens a print settings object into a Core Foundation data object for storage in a user document. (Deprecated in Mac OS X v10.5. Use PMPrintSettingsCreateDataRepresentation
instead.)
OSStatus PMFlattenPrintSettingsToCFData ( PMPrintSettings printSettings, CFDataRef *flatSetting );
The print settings object to flatten.
A pointer to your CFDataRef
variable. On return, the variable refers to a Core Foundation data object that contains a flattened representation of the specified print settings object. You are responsible for releasing the data object.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Flattens a print settings object into a URL for storage in a user document. (Deprecated in Mac OS X v10.5. Instead use PMPrintSettingsCreateDataRepresentation
and write the resulting data to your destination.)
OSStatus PMFlattenPrintSettingsToURL ( PMPrintSettings printSettings, CFURLRef flattenFileURL );
The print settings object to flatten.
A Core Foundation URL specifying a file to contain a flattened representation of the specified print settings object. If the file already exists, it is overwritten. Only file-based URLs are supported.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Obtains the output destination of a print job. (Deprecated in Mac OS X v10.5. Use PMSessionGetDestinationType
, PMSessionCopyDestinationFormat
, or PMSessionCopyDestinationLocation
instead.)
OSStatus PMGetDestination ( PMPrintSettings printSettings, PMDestinationType *destType, CFURLRef *fileURL );
The print settings object whose destination you want to obtain.
A pointer to your PMDestinationType
variable. On return, the variable indicates the destination for the print job. See “Destination Types.”
A pointer to your CFURLRef
variable. On return, the variable refers to a Core Foundation URL that contains the location of the print job destination.
A result code. See “Core Printing Result Codes.”
For print jobs that are sent to disk, as opposed a printer, you can use this function to obtain the location of the destination file. Valid within a printing session after creating a print settings object.
Before using this function you must call PMSessionValidatePrintSettings
or PMValidatePrintSettings
to ensure that the print settings object is valid.
This function does not take a print session parameter and therefore cannot indicate whether preview has been selected as the destination.
PMCoreDeprecated.h
Obtains the name of the print job. (Deprecated in Mac OS X v10.5. Use PMPrintSettingsGetJobName
instead.)
OSStatus PMGetJobNameCFString ( PMPrintSettings printSettings, CFStringRef *name );
The print settings object whose job name you want to obtain.
A pointer to your CFStringRef
variable. On return, the variable refers to a string that contains the name of the print job. Despite what its name implies, the function PMGetJobNameCFString
has Create/Copy semantics which means your application must release the string returned to it.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Obtains the current application’s drawing resolution. (Deprecated in Mac OS X v10.5. Draw using Quartz 2D and call CGContextScaleCTM
instead.)
OSStatus PMGetResolution ( PMPageFormat pageFormat, PMResolution *res );
The page format object whose drawing resolution you want to obtain.
A pointer to your PMResolution
structure. On return, the structure contains the drawing resolution of the current application.
A result code. See “Core Printing Result Codes.”
This function obtains the drawing resolution specified in the page format, not the resolution of the current printer. You can use PMPrinterGetPrinterResolutionCount
and PMPrinterGetIndexedPrinterResolution
to examine the available printer resolutions.
PMCoreDeprecated.h
Creates a paper object. (Deprecated in Mac OS X v10.5. Use PMPrinterGetPaperList
to find the built-in papers available for a given printer or use PMPaperCreateCustom
to create a custom paper.)
OSStatus PMPaperCreate ( PMPrinter printer, CFStringRef id, CFStringRef name, double width, double height, const PMPaperMargins *margins, PMPaper *paperP );
A printer object for which the paper is appropriate.
A unique identifier for this paper.
The name to display to the user for this paper.
The width of the paper, in points.
The height of the paper, in points.
A pointer to a PMPaperMargins
structure that specifies the unprintable margins of the paper, in points. The four values in the structure specify the top, left, bottom, and right imageable area margins of the paper.
A pointer to your PMPaper
variable. On return, the variable refers to a new paper object with the specified attributes. You are responsible for releasing the paper object with the function PMRelease
. The variable is set to NULL
if the object could not be created.
A result code. See “Core Printing Result Codes.”
This function creates a paper object appropriate for the specified printer. To obtain one of the available built-in paper sizes for a given printer, you should use the function PMPrinterGetPaperList
.
This function creates a paper object but does not mark it as a custom paper, so it appears to the printing system as if it were a built-in paper. This can be produce unpredictable results, so this function is deprecated.
PMCoreDeprecated.h
Obtains a resolution setting for the specified printer. (Deprecated in Mac OS X v10.5. Use PMPrinterGetPrinterResolutionCount
and PMPrinterGetIndexedPrinterResolution
to examine the available printer resolutions.)
OSStatus PMPrinterGetPrinterResolution ( PMPrinter printer, PMTag tag, PMResolution *res );
The printer whose resolution you want to obtain.
A tag that specifies the kind of resolution information you want to obtain (minimum, maximum, default, and so forth). See “Tag Constants” for a description of the constants you can pass in this parameter.
A pointer to your PMResolution
data structure. On return, the structure contains the resolution setting associated with the tag value.
A result code. The result code kPMNotImplemented
indicates that the printer driver does not support multiple resolution settings.
PMCoreDeprecated.h
Begins a print job that, by default, draws into a QuickDraw graphics port, and suppresses the printing status dialog. (Deprecated in Mac OS X v10.5. Use PMSessionBeginCGDocumentNoDialog
instead.)
OSStatus PMSessionBeginDocumentNoDialog ( PMPrintSession printSession, PMPrintSettings printSettings, PMPageFormat pageFormat );
The printing session that provides a context for the new print job.
The print settings to use for the new print job.
The page format to use for the new print job.
A result code. See “Core Printing Result Codes.”
The function PMSessionBeginDocumentNoDialog
starts a print job and should be called within your application’s print loop. This function is similar to the function PMSessionBeginDocument
except that the printing status dialog is suppressed.
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. If you present a printing dialog before you call PMSessionBeginDocumentNoDialog
, when calling this function you should use the same PMPrintSession
object you used to present the dialog.
Before you call PMSessionBeginDocumentNoDialog
, you should call PMSessionValidatePrintSettings
and PMSessionValidatePageFormat
to make sure the specified print settings and page format objects are updated and valid. After you call PMSessionBeginDocumentNoDialog
, if you call a function that changes the specified print settings or page format object, the change is ignored for the current print job.
This function must be called before its corresponding End
function (PMSessionEndDocumentNoDialog
). If the function PMSessionBeginDocumentNoDialog
returns noErr
, you must call the End
function, even if errors occur within the scope of the Begin
and End
functions.
The printing system automatically handles printing multiple copies. Your application does not need to perform any tasks other than specifying the number of copies in the printing session.
In Mac OS X v10.4 and later, Apple recommends using the function PMSessionBeginCGDocumentNoDialog
instead of this function. QuickDraw is deprecated and your application should be using Quartz 2D for its rendering.
PMCoreDeprecated.h
Disables use of a custom ColorSync profile previously enabled by the function PMSessionEnableColorSync
. (Deprecated in Mac OS X v10.5. There is no replacement; draw using Quartz 2D instead.)
OSStatus PMSessionDisableColorSync ( PMPrintSession printSession );
The printing session whose page-specific ColorSync profile you want to disable.
A result code. See “Core Printing Result Codes.”
You must call the PMSessionDisableColorSync
function between the creation and release of a printing session. See the function PMCreateSession
. You must call this function within the scope of calls to the functions PMSessionBeginPage
and PMSessionEndPage
.
The function PMSessionDisableColorSync
applies only to the current page. The function is useful only if the graphics context is QuickDraw and the current port is the printing port.
This function is deprecated because QuickDraw is deprecated. When drawing with Quartz, the current stroke and fill color space and the color space associated with an image are used to characterize color. Quartz provides ways to use ColorSync profiles to create color spaces, so you can characterize color using ColorSync simply by drawing with Quartz.
PMCoreDeprecated.h
Enables use of a custom ColorSync profile previously set by the function PMSetProfile
. (Deprecated in Mac OS X v10.5. There is no replacement; draw using Quartz 2D instead.)
OSStatus PMSessionEnableColorSync ( PMPrintSession printSession );
The printing session whose page-specific ColorSync profile you want to enable.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. You must call this function within the scope of calls to the functions PMSessionBeginPage
and PMSessionEndPage
.
The function PMSessionEnableColorSync
applies only to the current page. The function is useful only if the graphics context is QuickDraw and the current port is the printing port.
This function is deprecated because QuickDraw is deprecated. When drawing with Quartz, the current stroke and fill color space and the color space associated with an image are used to characterize color. Quartz provides ways to use ColorSync profiles to create color spaces, so you can characterize color using ColorSync simply by drawing with Quartz.
PMCoreDeprecated.h
Obtains the graphics context for the current page in a printing session. (Deprecated in Mac OS X v10.5. Use PMSessionGetCGGraphicsContext
instead.)
OSStatus PMSessionGetGraphicsContext ( PMPrintSession printSession, CFStringRef graphicsContextType, void **graphicsContext );
The printing session whose current graphics context you want to obtain.
The desired graphics context type. This parameter is currently ignored.
On return, a reference to the current graphics context. The graphics context returned is the one last set by a call to the function PMSessionSetDocumentFormatGeneration
or the default (QuickDraw) if there was no call to the function. You must typecast the context to an appropriate graphics type, either grafPtr
or CGContextRef
.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. See the function PMCreateSession
. You must also call the function PMSessionGetGraphicsContext
within the scope of the functions PMSessionBeginPage
and PMSessionEndPage
.
In Mac OS X v10.3 and earlier, you should call this function for each page you draw for a print job. After each call to the function PMSessionBeginPage
your application should call PMSessionGetGraphicsContext
to obtain the current graphics context. If that context is a QuickDraw context, then set the drawing port to this port by calling the QuickDraw SetPort
function. See the discussion of the function PMSessionBeginPage
for more information.
In Mac OS X v10.4 and later, Apple recommends using the function PMSessionGetCGGraphicsContext
instead of this function. QuickDraw is deprecated and your application should be using Quartz 2D for its rendering.
PMCoreDeprecated.h
Requests a particular page size, adjusted for the current rotation, resolution, or scaling settings. (Deprecated in Mac OS X v10.5. To set a particular paper size and margins, obtain or create a PMPaper
object and call PMCreatePageFormatWithPMPaper
.)
OSStatus PMSetAdjustedPageRect ( PMPageFormat pageFormat, const PMRect *pageRect );
The page format object whose page rectangle you want to set.
A pointer to your PMRect
data structure that specifies the desired size of the page rectangle, in points. The top-left coordinates should be (0,0). See Supporting Printing in Your Carbon Application for more information on page and paper rectangles.
A result code. See “Core Printing Result Codes.”
This function is not recommended. You should call this function only if your application provides desktop publishing and the Page Setup dialog does not provide sufficient control. Typically, such applications display their own specialized document format dialog.
If you decide to use this function, you must call the function between the creation and release of a printing session. See the function PMCreateSession
. You can use PMSetAdjustedPageRect
to set a drawing rectangle without going through the Page Setup dialog or calling other page format accessor functions. This function allows an application to specify the dimensions of the imageable area into which it draws.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCoreDeprecated.h
Specifies the name of a print job. (Deprecated in Mac OS X v10.5. Use PMPrintSettingsSetJobName
instead.)
OSStatus PMSetJobNameCFString ( PMPrintSettings printSettings, CFStringRef name );
The print settings object whose job name you want to set.
The new name for the print job.
A result code. See “Core Printing Result Codes.” The result code kPMInvalidParameter
is returned if you pass NULL
or an empty string in the name
parameter.
You should call this function before you open the Print dialog.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCoreDeprecated.h
Embeds a color profile during printing. (Deprecated in Mac OS X v10.5. There is no replacement; draw using Quartz 2D instead.)
OSStatus PMSetProfile ( PMPrintSettings printSettings, PMTag tag, const CMProfileLocation *profile );
The print settings object in which to embed the color profile.
A tag that describes the usage of the profile. Currently, the only tag value you can pass is the constant kPMSourceProfile
. See “Tag Constants” for more information on this constant.
A pointer to a structure of type CMProfileLocation
that specifies the location of a ColorSync profile. The profile must be version 2 or later. If you pass a profile that is an earlier version, the function returns the result code kPMNotImplemented
.
A result code. See “Core Printing Result Codes.”
You can use the function PMSetProfile
to tag QuickDraw drawing with a custom ColorSync profile. The function PMSetProfile
is useful only if the graphics context is QuickDraw and the current port is the printing port.
You should call this function each time you want to change the profile used to draw page elements. The printing system resets the profile to the default at the beginning of each page. If you call the function PMSetProfile
a second time, the old profile is ignored.
This function is deprecated because QuickDraw is deprecated. When drawing with Quartz, the current stroke and fill color space and the color space associated with an image are used to characterize color. Quartz provides ways to use ColorSync profiles to create color spaces, so you can characterize color using ColorSync simply by drawing with Quartz.
PMCoreDeprecated.h
Sets the application drawing resolution. (Deprecated in Mac OS X v10.5. Draw using Quartz 2D and call CGContextScaleCTM
instead.)
OSStatus PMSetResolution ( PMPageFormat pageFormat, const PMResolution *res );
The page format object whose drawing resolution you want to set.
A pointer to a structure of type PMResolution
that specifies the desired drawing resolution for your application. You should specify the best resolution for your data. The printing system handles the mapping between the resolution you specify and the printer resolution.
A result code. See “Core Printing Result Codes.”
If you call this function after initiating a print job, the change is ignored for the current job.
This function was needed in the past because QuickDraw uses integer coordinates and has no notion of scaling coordinate systems. For Quartz drawing, this function is obsolete. To change the resolution, draw with fractional coordinates or scale the coordinate system and draw with integer coordinates.
PMCoreDeprecated.h
Requests a particular paper size, unaffected by rotation, resolution, or scaling. (Deprecated in Mac OS X v10.5. To set a particular paper size, obtain or create a PMPaper
object and call PMCreatePageFormatWithPMPaper
.)
OSStatus PMSetUnadjustedPaperRect ( PMPageFormat pageFormat, const PMRect *paperRect );
The page format object whose unadjusted paper rectangle you want to set.
A pointer to a structure of type PMRect
that specifies the desired paper size, in points. The coordinates of the upper-left corner of the paper rectangle are specified relative to the page rectangle. See Supporting Printing in Your Carbon Application for more information on page and paper rectangles.
A result code. See “Core Printing Result Codes.” The result code kPMValueOutOfRange
indicates that the printer driver does not support the requested page size.
This function is not recommended. You should call this function only if your application provides desktop publishing and the Page Setup dialog does not provide sufficient control. Typically, such applications display their own specialized document format dialog.
If you decide to use this function, you must call it between the creation and release of a printing session. After using the function PMSetUnadjustedPaperRect
you should always call PMSessionValidatePageFormat
then call PMGetUnadjustedPaperRect
to verify that the paper size you set is recorded by the printer driver.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCoreDeprecated.h
Rebuilds a page format object from a Memory Manager handle that contains flattened page format data. (Deprecated in Mac OS X v10.5. Use PMPageFormatCreateWithDataRepresentation
instead.)
OSStatus PMUnflattenPageFormat ( Handle flatFormat, PMPageFormat *pageFormat );
A handle to a previously flattened page format object. You are responsible for disposing of the handle.
A pointer to your PMPageFormat
variable. On return, the variable refers to a page format object that contains the data retrieved from the flattened page format data. You are responsible for releasing the page format object with the function PMRelease
.
A result code. See “Core Printing Result Codes.” The result code kPMInvalidParameter
is returned if the flattened PMPageFormat
object was created by an incompatible version of Core Printing.
The PMUnflattenPageFormat
function creates a new PMPageFormat
object that contains the data from the flattened page format data. You should call the function PMSessionValidatePageFormat
to make sure the page format object contains valid values.
If the function returns the result code kPMInvalidParameter
you need to create a new, default page format object. You should also notify the user that the flattened page format is not valid.
PMCoreDeprecated.h
Rebuilds a page format object from a Core Foundation data object that contains flattened page format data. (Deprecated in Mac OS X v10.5. Use PMPageFormatCreateWithDataRepresentation
instead.)
OSStatus PMUnflattenPageFormatWithCFData ( CFDataRef flattenCFData, PMPageFormat *pageFormat );
A Core Foundation data object that contains a flattened representation of a page format object.
A pointer to your PMPageFormat
variable. On return, the variable refers to a page format object that is rebuilt from the specified Core Foundation data object. You are responsible for releasing the page format object with the function PMRelease
.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Rebuilds a page format object from a file system URL that contains flattened page format data. (Deprecated in Mac OS X v10.5. Instead read the data into a CFData object and use PMPageFormatCreateWithDataRepresentation
.)
OSStatus PMUnflattenPageFormatWithURL ( CFURLRef flattenFileURL, PMPageFormat *pageFormat );
A Core Foundation URL that specifies a file containing a flattened representation of a page format object.
A pointer to your PMPageFormat
variable. On return, the variable refers to a page format object that is rebuilt from the specified file. You are responsible for releasing the page format object with the function PMRelease
.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Rebuilds a print settings object from a Memory Manager handle that contains flattened print settings data. (Deprecated in Mac OS X v10.5. Use PMPrintSettingsCreateWithDataRepresentation
instead.)
OSStatus PMUnflattenPrintSettings ( Handle flatSettings, PMPrintSettings *printSettings );
A handle to a flattened representation of a print settings object.
A pointer to your PMPrintSettings
variable. On return, the variable refers to a print settings object that contains the data retrieved from the flattened print settings. You are responsible for releasing the print settings object with the function PMRelease
.
A result code. See “Core Printing Result Codes.” The result code kPMInvalidParameter
is returned if the flattened PMPrintSettings
object was created by an incompatible version of Core Printing.
The PMUnflattenPrintSettings
function creates a new PMPrintSettings
object containing the data from the flattened print settings. You should call the function PMSessionValidatePrintSettings
, as some values in the print settings object may no longer be valid.
If the function returns the result code kPMInvalidParameter
you need to create a new, default print settings object. You should also notify the user that the print settings are not valid.
There are no scoping requirements as to when you may use this function.
PMCoreDeprecated.h
Rebuilds a print settings object from a Core Foundation data object that contains flattened print settings data. (Deprecated in Mac OS X v10.5. Use PMPrintSettingsCreateWithDataRepresentation
instead.)
OSStatus PMUnflattenPrintSettingsWithCFData ( CFDataRef flattenCFData, PMPrintSettings *printSettings );
A flattened representation of a print settings object.
A pointer to your PMPrintSettings
variable. On return, the variable refers to a print settings object rebuilt from the specified Core Foundation data object. You are responsible for releasing the print settings object with the function PMRelease
.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
Rebuilds a print settings object from a file that contains flattened print settings data. (Deprecated in Mac OS X v10.5. Instead read the data into a CFData object and use PMPrintSettingsCreateWithDataRepresentation
.)
OSStatus PMUnflattenPrintSettingsWithURL ( CFURLRef flattenFileURL, PMPrintSettings *printSettings );
A file containing a flattened representation of a print settings object.
A pointer to your PMPrintSettings
variable. On return, the variable refers to a print settings object rebuilt from the specified file. You are responsible for releasing the print settings object with the function PMRelease
.
A result code. See “Core Printing Result Codes.”
PMCoreDeprecated.h
© 2001, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-07-24)