| Framework | ApplicationServices/ApplicationServices.h |
| Declared in | PMCore.h PMCoreDeprecated.h PMDefinitions.h PMDefinitionsDeprecated.h |
Core Printing is a C API that Mac OS X applications and command line tools can use to perform printing tasks that don’t display a user interface. Core Printing defines a set of opaque types and a rich set of operations on instances of these types. The Core Printing opaque types include:
PMPrintSession for general information about a print job
PMPrintSettings for print job parameters
PMPageFormat for the page format of a printed document
PMPaper for information about a type of paper
PMPrinter for information about a printer
In Carbon applications, Core Printing is used together with Carbon Printing to implement printing features. For more information about Carbon Printing, see Carbon Printing Reference.
In Cocoa applications, Core Printing can be used to extend the functionality in the Cocoa printing classes. The NSPrintInfo class provides direct access to some Core Printing objects.
Note: Core Printing is available to 64-bit applications, except for functions, data types, and constants that have been deprecated.
PMCreatePageFormat
PMCreatePageFormatWithPMPaper
PMCopyPageFormat
PMSessionDefaultPageFormat
PMSessionValidatePageFormat
PMSessionCreatePageFormatList
PMPageFormatCreateDataRepresentation
PMPageFormatCreateWithDataRepresentation
PMFlattenPageFormat Deprecated in Mac OS X v10.5
PMFlattenPageFormatToCFData Deprecated in Mac OS X v10.5
PMFlattenPageFormatToURL Deprecated in Mac OS X v10.5
PMUnflattenPageFormat Deprecated in Mac OS X v10.5
PMUnflattenPageFormatWithCFData Deprecated in Mac OS X v10.5
PMUnflattenPageFormatWithURL Deprecated in Mac OS X v10.5
PMGetPageFormatExtendedData
PMSetPageFormatExtendedData
PMGetPageFormatPaper
PMPageFormatGetPrinterID
PMGetOrientation
PMSetOrientation
PMGetScale
PMSetScale
PMGetAdjustedPageRect
PMGetAdjustedPaperRect
PMGetUnadjustedPageRect
PMGetUnadjustedPaperRect
PMGetResolution Deprecated in Mac OS X v10.5
PMSetAdjustedPageRect Deprecated in Mac OS X v10.5
PMSetResolution Deprecated in Mac OS X v10.5
PMSetUnadjustedPaperRect Deprecated in Mac OS X v10.5
PMCreatePrintSettings
PMSessionDefaultPrintSettings
PMSessionValidatePrintSettings
PMPrintSettingsCreateDataRepresentation
PMPrintSettingsCreateWithDataRepresentation
PMCopyPrintSettings
PMPrintSettingsToOptions
PMPrintSettingsToOptionsWithPrinterAndPageFormat
PMFlattenPrintSettings Deprecated in Mac OS X v10.5
PMFlattenPrintSettingsToCFData Deprecated in Mac OS X v10.5
PMFlattenPrintSettingsToURL Deprecated in Mac OS X v10.5
PMUnflattenPrintSettings Deprecated in Mac OS X v10.5
PMUnflattenPrintSettingsWithCFData Deprecated in Mac OS X v10.5
PMUnflattenPrintSettingsWithURL Deprecated in Mac OS X v10.5
PMGetPrintSettingsExtendedData
PMSetPrintSettingsExtendedData
PMGetFirstPage
PMSetFirstPage
PMGetLastPage
PMSetLastPage
PMGetPageRange
PMSetPageRange
PMPrintSettingsGetJobName
PMPrintSettingsSetJobName
PMGetCopies
PMSetCopies
PMGetCollate
PMSetCollate
PMGetDuplex
PMSetDuplex
PMPrintSettingsGetValue
PMPrintSettingsSetValue
PMPrintSettingsCopyAsDictionary
PMPrintSettingsCopyKeys
PMGetJobNameCFString Deprecated in Mac OS X v10.5
PMSetJobNameCFString Deprecated in Mac OS X v10.5
PMSessionGetDataFromSession
PMSessionSetDataInSession
PMSessionGetCurrentPrinter
PMSessionSetCurrentPMPrinter
PMSessionGetCGGraphicsContext
PMSessionError
PMSessionSetError
PMSessionGetGraphicsContext Deprecated in Mac OS X v10.5
PMSessionGeneral Deprecated in Mac OS X v10.4
PMSessionGetDocumentFormatGeneration Deprecated in Mac OS X v10.4
PMSessionSetCurrentPrinter Deprecated in Mac OS X v10.4
PMSessionSetDocumentFormatGeneration Deprecated in Mac OS X v10.4
PMPaperCreateCustom
PMPaperIsCustom
PMPaperCreate Deprecated in Mac OS X v10.5
PMPaperGetID
PMPaperGetName
PMPaperGetWidth
PMPaperGetHeight
PMPaperGetMargins
PMPaperCreateLocalizedName
PMPaperGetPrinterID
PMPaperGetPPDPaperName
PMSessionBeginCGDocumentNoDialog
PMSessionEndDocumentNoDialog
PMSessionBeginPageNoDialog
PMSessionEndPageNoDialog
PMSessionBeginDocumentNoDialog Deprecated in Mac OS X v10.5
PMSessionSetIdleProc Deprecated in Mac OS X v10.4
PMSessionSetDestination
PMSessionGetDestinationType
PMSessionCopyDestinationFormat
PMSessionCopyDestinationLocation
PMSessionCopyOutputFormatList
PMServerLaunchPrinterBrowser
PMServerCreatePrinterList
PMSessionCreatePrinterList
PMPrinterCreateFromPrinterID
PMCreateGenericPrinter
PMPrinterCopyDescriptionURL
PMPrinterCopyDeviceURI
PMPrinterCopyHostName
PMPrinterCopyPresets
PMPrinterGetCommInfo
PMPrinterGetDriverCreator
PMPrinterGetDriverReleaseInfo
PMPrinterGetID
PMPrinterGetLanguageInfo
PMPrinterGetLocation
PMPrinterGetMakeAndModelName
PMPrinterGetMimeTypes
PMPrinterGetName
PMPrinterGetOutputResolution
PMPrinterSetOutputResolution
PMPrinterGetPaperList
PMPrinterGetPrinterResolutionCount
PMPrinterGetIndexedPrinterResolution
PMPrinterGetState
PMPrinterSetDefault
PMPrinterIsDefault
PMPrinterIsFavorite
PMPrinterIsPostScriptCapable
PMPrinterIsPostScriptPrinter
PMPrinterIsRemote
PMPrinterGetPrinterResolution Deprecated in Mac OS X v10.5
PMPrinterGetDescriptionURL Deprecated in Mac OS X v10.4
PMPrinterGetDeviceURI Deprecated in Mac OS X v10.4
PMCGImageCreateWithEPSDataProvider
PMPrinterWritePostScriptToURL
PMSessionPostScriptBegin Deprecated in Mac OS X v10.4
PMSessionPostScriptData Deprecated in Mac OS X v10.4
PMSessionPostScriptEnd Deprecated in Mac OS X v10.4
PMSessionPostScriptFile Deprecated in Mac OS X v10.4
PMSessionPostScriptHandle Deprecated in Mac OS X v10.4
PMSessionSetPSInjectionData Deprecated in Mac OS X v10.4
PMSessionDisableColorSync Deprecated in Mac OS X v10.5
PMSessionEnableColorSync Deprecated in Mac OS X v10.5
PMSetProfile Deprecated in Mac OS X v10.5
PMSessionConvertOldPrintRecord Deprecated in Mac OS X v10.4
PMSessionMakeOldPrintRecord Deprecated in Mac OS X v10.4
DisposePMIdleUPP Deprecated in Mac OS X v10.4
InvokePMIdleUPP Deprecated in Mac OS X v10.4
NewPMIdleUPP Deprecated in Mac OS X v10.4
PMGetDestination Deprecated in Mac OS X v10.5
PMBegin Deprecated in Mac OS X v10.4
PMConvertOldPrintRecord Deprecated in Mac OS X v10.4
PMDefaultPageFormat Deprecated in Mac OS X v10.4
PMDefaultPrintSettings Deprecated in Mac OS X v10.4
PMDisableColorSync Deprecated in Mac OS X v10.4
PMDisposePageFormat Deprecated in Mac OS X v10.4
PMDisposePrintSettings Deprecated in Mac OS X v10.4
PMEnableColorSync Deprecated in Mac OS X v10.4
PMEnd Deprecated in Mac OS X v10.4
PMError Deprecated in Mac OS X v10.4
PMGeneral Deprecated in Mac OS X v10.4
PMGetColorMode Deprecated in Mac OS X v10.4
PMGetDriverCreator Deprecated in Mac OS X v10.4
PMGetDriverReleaseInfo Deprecated in Mac OS X v10.4
PMGetGrafPtr Deprecated in Mac OS X v10.4
PMGetIndexedPrinterResolution Deprecated in Mac OS X v10.4
PMGetJobName Deprecated in Mac OS X v10.4
PMGetLanguageInfo Deprecated in Mac OS X v10.4
PMGetPhysicalPageSize Deprecated in Mac OS X v10.4
PMGetPhysicalPaperSize Deprecated in Mac OS X v10.4
PMGetPrinterResolution Deprecated in Mac OS X v10.4
PMGetPrinterResolutionCount Deprecated in Mac OS X v10.4
PMIsPostScriptDriver Deprecated in Mac OS X v10.4
PMMakeOldPrintRecord Deprecated in Mac OS X v10.4
PMNewPageFormat Deprecated in Mac OS X v10.4
PMNewPrintSettings Deprecated in Mac OS X v10.4
PMPostScriptBegin Deprecated in Mac OS X v10.4
PMPostScriptData Deprecated in Mac OS X v10.4
PMPostScriptEnd Deprecated in Mac OS X v10.4
PMPostScriptFile Deprecated in Mac OS X v10.4
PMPostScriptHandle Deprecated in Mac OS X v10.4
PMSessionGetDocumentFormatSupported Deprecated in Mac OS X v10.4
PMSessionIsDocumentFormatSupported Deprecated in Mac OS X v10.4
PMSetColorMode Deprecated in Mac OS X v10.4
PMSetError Deprecated in Mac OS X v10.4
PMSetIdleProc Deprecated in Mac OS X v10.4
PMSetJobName Deprecated in Mac OS X v10.4
PMSetPhysicalPaperSize Deprecated in Mac OS X v10.4
PMValidatePageFormat Deprecated in Mac OS X v10.4
PMValidatePrintSettings Deprecated in Mac OS X v10.4
Creates an image that references both the PostScript contents of EPS data and a preview (proxy) image for the data.
CGImageRef PMCGImageCreateWithEPSDataProvider ( CGDataProviderRef epsDataProvider, CGImageRef epsPreview );
A Quartz data provider that supplies the PostScript contents of the EPS file. The EPS data must begin with the EPSF required header and bounding box DSC (Document Structuring Conventions) comments.
A Quartz image that serves as the proxy image for the EPS file. When the image returned by this function is rendered onscreen or sent to a printer that cannot render PostScript, this proxy image is drawn instead.
An image capable of rendering either the EPS content or the proxy image, depending upon the capabilities of the destination printer.
It is likely that data will not be read from the EPS data provider until after this function returns. You should be careful not to free the underlying EPS data until the data provider's release function is invoked. Similarly, do not free the preview image data until the image data provider's release function is invoked. You are responsible for releasing the data providers for the EPS image and the EPS preview image.
Note that in Mac OS X v10.3 and later, Quartz can convert EPS data into PDF data. Using this feature and then using Quartz to draw the resulting PDF data may produce superior results for your application. See CGPSConverter Reference for details.
PMCore.hObtains the list of PostScript printer description (PPD) files in a PPD domain.
OSStatus PMCopyAvailablePPDs ( PMPPDDomain domain, CFArrayRef *ppds );
The PPD domain to search. See “PostScript Printer Description File Domains” for a description of the constants you can use to specify the domain.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array of PPD files in the specified domain. Each element in the array is a Core Foundation URL object that specifies the location of a PPD file or a compressed PPD file. You are responsible for releasing the array. If the specified domain is not valid, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains a localized PostScript printer description (PPD) file.
OSStatus PMCopyLocalizedPPD ( CFURLRef ppd, CFURLRef *localizedPPD );
A Core Foundation URL object for a PPD file. You can obtain a PPD URL using the function PMCopyAvailablePPDs.
A pointer to your CFURLRef variable. On return, the variable refers to a Core Foundation URL object. The URL specifies the location of a PPD file or a compressed PPD file that has been localized for the current user's language preference. You are responsible for releasing the URL. If the ppd parameter is not valid, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
To access the data in the PPD file, you can use the function PMCopyPPDData.
In Mac OS X v10.5 and later, the printing system supports globalized PPD files as defined in CUPS version 1.2 and later. A globalized PPD file contains multiple localizations within a single file. If a globalized PPD file exists, this function returns the URL to this file and it is up to the application to obtain the correct localized data. For more information, see CUPS PPD Extensions.
PMCore.h
Copies the settings from one page format object into another.
OSStatus PMCopyPageFormat ( PMPageFormat formatSrc, PMPageFormat formatDest );
The page format object to duplicate.
The page format object to receive the copied settings. On return, this object contains the same settings as the formatSrc object.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains the uncompressed PPD data for a PostScript printer description (PPD) file.
OSStatus PMCopyPPDData ( CFURLRef ppd, CFDataRef *data );
A URL for a PPD or compressed PPD file. You can obtain a PPD URL using the function PMCopyAvailablePPDs or PMCopyLocalizedPPD.
A pointer to your CFDataRef variable. On return, the variable refers to a Core Foundation data object containing the uncompressed PPD data from the specified PPD file. You are responsible for releasing the data object. If the ppd parameter does not reference a PPD file, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
PMCore.h
Copies the settings from one print settings object into another.
OSStatus PMCopyPrintSettings ( PMPrintSettings settingSrc, PMPrintSettings settingDest );
The print settings object to duplicate.
The print settings object to receive the copied settings. On return, this object contains the same settings as the settingSrc object.
A result code. See “Core Printing Result Codes.”
PMCore.hCreates a generic printer object.
OSStatus PMCreateGenericPrinter ( PMPrinter *printer );
A pointer to your PMPrinter variable. On return, the variable refers to a new printer object that represents the generic formatting printer. You are responsible for releasing the printer object with the function PMRelease.
A result code. See “Core Printing Result Codes.”
This function provides a way to create a PMPrinter object that represents the generic formatting printer.
PMCore.h
Creates a new page format object.
OSStatus PMCreatePageFormat ( PMPageFormat *pageFormat );
A pointer to your PMPageFormat variable. On return, the variable refers to a new page format object. You are responsible for releasing the page format object with the function PMRelease.
A result code. See “Core Printing Result Codes.”
This function allocates memory for a new page format object in your application’s memory space and sets its reference count to 1. The new page format object is empty and unusable until you call PMSessionDefaultPageFormat or PMCopyPageFormat.
PMCore.hCreates a page format object with a specified paper.
OSStatus PMCreatePageFormatWithPMPaper ( PMPageFormat *pageFormat, PMPaper paper );
A pointer to your PMPageFormat variable. On return, the variable refers to a new page format object that represents the specified paper. You are responsible for releasing the page format object with the function PMRelease.
The type of paper for the new page format object.
A result code. See “Core Printing Result Codes.”
PMCore.h
Creates a new print settings object.
OSStatus PMCreatePrintSettings ( PMPrintSettings *printSettings );
A pointer to your PMPrintSettings variable. On return, the variable refers to a new print settings object. You are responsible for releasing the print settings object with the function PMRelease.
A result code. See “Core Printing Result Codes.”
This function allocates memory for a new print settings object in your application’s memory space and sets its reference count to 1. The new print settings object is empty and unusable until you call PMSessionDefaultPrintSettings or PMCopyPrintSettings.
PMCore.h
Creates and initializes a printing session object and creates a context for printing operations.
OSStatus PMCreateSession ( PMPrintSession *printSession );
A pointer to your PMPrintSession variable. On return, the variable refers to a new printing session object. You are responsible for releasing the printing session object with the function PMRelease.
A result code. See “Core Printing Result Codes.”
This function allocates memory for a new printing session object in your application’s memory space and sets its reference count to 1. The new printing session object is initialized with information that the printing system uses for a print job.
PMCore.h
Obtains the imageable area or page rectangle, taking into account orientation, application drawing resolution, and scaling settings.
OSStatus PMGetAdjustedPageRect ( PMPageFormat pageFormat, PMRect *pageRect );
The page format object whose adjusted page rectangle you want to obtain.
A pointer to your PMRect structure. On return, the structure contains the current imageable area, in points, taking into account scaling, rotation, and application resolution settings. The page rectangle is the area of the page to which an application can draw. The coordinates for the upper-left corner of the page rectangle are (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.”
Before using this function, you must call PMSessionValidatePageFormat to ensure that the values for the adjusted page rectangle correctly account for scaling, rotation, and application resolution settings.
PMCore.h
Obtains the rectangle defining the paper size, taking into account orientation, application drawing resolution, and scaling settings.
OSStatus PMGetAdjustedPaperRect ( PMPageFormat pageFormat, PMRect *paperRect );
The page format object whose adjusted paper rectangle you want to obtain.
A pointer to your PMRect structure. On return, the structure describes the current paper size, in points, taking into account scaling, rotation, and application resolution settings. The coordinates of the upper-left corner of the paper rectangle are specified relative to the page rectangle. The coordinates of the upper-left corner of the page rectangle are always (0,0), which means the coordinates of the upper-left corner of the paper rectangle are always negative or (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.”
Before using this function, you must call the function PMSessionValidatePageFormat to ensure that the values for the adjusted paper rectangle correctly account for scaling, rotation, and application resolution settings.
PMCore.hObtains a Boolean value that indicates whether the job collate option is selected.
OSStatus PMGetCollate ( PMPrintSettings printSettings, Boolean *collate );
The print settings object you’re querying to determine whether the job collate option is selected.
A pointer to your Boolean variable. On return, true if the job collate option is selected; otherwise, false.
A result code. See “Core Printing Result Codes.”
The Collated checkbox is displayed in the Copies & Pages pane of the Print dialog. This option determines how printed material is organized. For example, if you have a document that is three pages long and you are printing multiple copies with the Collated option selected, the job prints pages 1, 2, and 3 in that order and then repeats. However, if the Collated option is not selected and you’re printing multiple copies of those same three pages, the job prints copies of page 1, then copies of page 2, and finally copies of page 3.
PMCore.h
Obtains the number of copies that the user requests to be printed.
OSStatus PMGetCopies ( PMPrintSettings printSettings, UInt32 *copies );
The print settings object whose number of copies you want to obtain.
A pointer to your UInt32 variable. On return, the variable contains the number of copies requested by the user.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains the selected duplex mode.
OSStatus PMGetDuplex ( PMPrintSettings printSettings, PMDuplexMode *duplexSetting );
The print settings object whose duplex mode you want to obtain.
A pointer to your PMDuplexMode variable. On return, the variable contains the duplex mode setting in the current print job. Possible values include:
kPMDuplexNone (one-sided printing)
kPMDuplexNoTumble (two-sided printing)
kPMDuplexTumble (two-sided printing with tumbling)
See “Duplex Modes” for a full description of the duplex mode constants.
A result code. See “Core Printing Result Codes.”
Duplex printing is a print job that prints on both sides of the paper. The Two-Sided printing control is displayed in the Layout pane of the Print dialog.
PMCore.h
Obtains the number of the first page to be printed.
OSStatus PMGetFirstPage ( PMPrintSettings printSettings, UInt32 *first );
The print settings object whose first page number you want to obtain.
A pointer to your UInt32 variable. On return, the variable contains the page number of the first page to print. The default first page number is 1.
A result code. See “Core Printing Result Codes.”
You can use this function to obtain the page number entered by the user in the From field of the Print dialog. If the user selects the All button, the function returns a value of 1. If the user did not enter a value, the function returns the value of the previous call to PMSetFirstPage, if any, or the default value of 1.
PMCore.h
Obtains the number of the last page to be printed.
OSStatus PMGetLastPage ( PMPrintSettings printSettings, UInt32 *last );
The print settings object whose last page number you want to obtain.
A pointer to your UInt32 variable. On return, the variable contains the page number of the last page to print.
A result code. See “Core Printing Result Codes.”
You use this function to obtain the page number entered by the user in the To field of the Print dialog. If the user did not enter a value, the function returns the value of the previous call to PMSetLastPage, if any, or a default value.
You should not look for the constant kPMPrintAllPages. That constant is used only with the PMSetLastPage and PMSetPageRange functions to specify a last page. It is not returned by the PMGetLastPage function.
PMCore.h
Obtains the current setting for page orientation.
OSStatus PMGetOrientation ( PMPageFormat pageFormat, PMOrientation *orientation );
The page format object whose orientation you want to obtain.
A pointer to your PMOrientation variable. On return, the variable contains a constant value indicating the page orientation. Supported values are:
kPMPortrait
kPMLandscape
kPMReversePortrait (supported in Mac OS X v10.5 and later)
kPMReverseLandscape
See “Page Orientation Constants” for a complete description of the page orientation constants.
A result code. See “Core Printing Result Codes.”
PMCore.h
Obtains extended page format data previously stored by your application.
OSStatus PMGetPageFormatExtendedData ( PMPageFormat pageFormat, OSType dataID, UInt32 *size, void *extendedData );
The page format object that contains your extended data.
A 4-character code that identifies your data. This is typically your application’s creator code. If your creator code is outside the ASCII 7-bit character range 0x20–0x7F, you need to use a different 4-character code.
A pointer to a value that specifies the size of the buffer you have allocated for the extended page format data. On return, this variable contains the number of bytes read into the buffer or the size of the extended data. You can pass the constant kPMDontWantSize if you do not need this information. (See “Data Not Wanted Constants” for more information.)
A pointer to a buffer to receive the extended data. Pass the constant kPMDontWantData if you do not want to read the data. (See “Data Not Wanted Constants” for more information.)
A result code. See “Core Printing Result Codes.”
Your application typically needs to call the function PMGetPageFormatExtendedData two times in order to retrieve the extended page format data. The first time, pass the constant kPMDontWantData in the parameter extendedData to obtain the buffer size required for the extended data. Then allocate the buffer and call the function a second time to read the extended data into your buffer.
If you write a printing dialog extension for your application that stores data in the page format object, you use the function PMGetPageFormatExtendedData to retrieve the data associated with it.
PMCore.hObtains the paper associated with a page format object.
OSStatus PMGetPageFormatPaper ( PMPageFormat format, PMPaper *paper );
The page format object whose paper you want to obtain.
A pointer to your PMPaper variable. On return, the variable refers to a paper object that represents the paper associated with the specified page format. You should not release the paper object without first retaining it.
A result code. See “Core Printing Result Codes.”
PMCore.h
Obtains the valid range of pages that can be printed.
OSStatus PMGetPageRange ( PMPrintSettings printSettings, UInt32 *minPage, UInt32 *maxPage );
The print settings object whose page range you want to obtain.
A pointer to your UInt32 variable. On return, the variable contains the minimum page number allowed.
A pointer to your UInt32 variable. On return, the variable contains the maximum page number allowed.
A result code. See “Core Printing Result Codes.”
The page range returned by the function PMGetPageRange is independent of the first and last page values returned by PMGetFirstPage and PMGetLastPage. See PMSetPageRange for more information.
PMCore.h
Obtains extended print settings data previously stored by your application.
OSStatus PMGetPrintSettingsExtendedData ( PMPrintSettings printSettings, OSType dataID, UInt32 *size, void *extendedData );
The print settings object whose extended data you want to obtain.
The unique 4-character code of the data to retrieve. This is typically your application’s creator code. However, if your creator code is outside the ASCII 7-bit character range 0x20–0x7F, you need to use a different 4-character code.
A pointer to a value that specifies the size of the buffer you have allocated for the extended print settings data. On return, this variable contains the number of bytes read into the buffer or the size of the extended data. You can pass the constant kPMDontWantSize if you do not need this information. (See “Data Not Wanted Constants” for more information.)
A pointer to a buffer to receive the extended data. Pass the constant kPMDontWantData if you do not want to read the data. (See “Data Not Wanted Constants” for more information.)
A result code. See “Core Printing Result Codes.”
Your application typically needs to call PMGetPrintSettingsExtendedData two times in order to retrieve the extended print settings data. The first time, pass the constant kPMDontWantData in the extendedData parameter to obtain the buffer size required for the extended data. Then allocate the buffer and call the function a second time to read the extended data into your buffer.
You may find it easier to use the functions PMPrintSettingsSetValue and PMPrintSettingsGetValue to store and retrieve user-defined data in a print settings object. If you use these functions, make sure that the custom keys you define for your private data do not conflict with other print settings keys.
PMCore.h
Obtains the scaling factor currently applied to the page and paper rectangles.
OSStatus PMGetScale ( PMPageFormat pageFormat, double *scale );
The page format object whose scaling factor you want to obtain.
A pointer to your double-precision variable. On return, the variable contains the scaling factor expressed as a percentage. For example, a value of 100.0 means 100 percent (that is, no scaling); a value of 50.0 means 50 percent scaling.
A result code. See “Core Printing Result Codes.”
PMCore.h
Obtains the imageable area or page rectangle, unaffected by orientation, resolution, or scaling.
OSStatus PMGetUnadjustedPageRect ( PMPageFormat pageFormat, PMRect *pageRect );
The page format object whose unadjusted page rectangle you want to obtain.
A pointer to your PMRect data structure. On return, the structure contains the size of the page rectangle, in points. The page rectangle is the area of the page to which an application can draw. The coordinates for the upper-left corner of the page rectangle are (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.”
PMCore.h
Obtains the paper rectangle, unaffected by rotation, resolution, or scaling.
OSStatus PMGetUnadjustedPaperRect ( PMPageFormat pageFormat, PMRect *paperRect );
The page format object whose unadjusted paper rectangle you want to obtain.
A pointer to your PMRect data structure. On return, the structure contains the physical size of the paper, in points. The coordinates of the upper-left corner of the paper rectangle are specified relative to the page rectangle. The coordinates of the upper-left corner of the page rectangle are always (0,0), which means the coordinates of the upper-left corner of the paper rectangle are always negative or (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.”
PMCore.hCreates a data representation of a page format object.
OSStatus PMPageFormatCreateDataRepresentation ( PMPageFormat pageFormat, CFDataRef *data, PMDataFormat format );
The page format object to convert.
A pointer to your CFDataRef variable. On return, the variable refers to a new Core Foundation data object that contains a representation of the specified page format object in the specified data format. You are responsible for releasing the data object.
A constant that specifies the format of the data representation. Supported values are:
kPMDataFormatXMLDefault (compatible with all Mac OS X versions)
kPMDataFormatXMLMinimal (approximately 3-5 times smaller; compatible with Mac OS X v10.5 and later)
kPMDataFormatXMLCompressed (approximately 20 times smaller; compatible with Mac OS X v10.5 and later)
See “Data Representation Formats” for a full description of these formats.
A result code. See “Core Printing Result Codes.”
This function is typically used to convert a page format object into a data representation suitable for storage in a user document. For information about using a Core Foundation data object, see CFData Reference.
Before calling this function, you should call the function PMSessionValidatePageFormat to make sure the page format object contains valid values.
PMCore.hCreates a page format object from a data representation.
OSStatus PMPageFormatCreateWithDataRepresentation ( CFDataRef data, PMPageFormat *pageFormat );
The data representation of a page format object. The data representation must have been previously created with the function PMPageFormatCreateDataRepresentation.
A pointer to your PMPageFormat variable. On return, the variable refers to a new page format object that contains the information stored in the specified data object. You are responsible for releasing the page format object with the function PMRelease.
A result code. See “Core Printing Result Codes.”
This function is typically used to convert a data representation stored in a user document back into a page format object. For information about creating a Core Foundation data object from raw data, see CFData Reference.
After calling this function, you should call the function PMSessionValidatePageFormat to make sure the page format object contains valid values.
PMCore.hObtains the identifier of the formatting printer for a page format object.
OSStatus PMPageFormatGetPrinterID ( PMPageFormat pageFormat, CFStringRef *printerID );
The page format object whose printer identifier you want to obtain.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string that contains the identifier of the formatting printer for the specified page format object. If the page format object does not have that information, the variable is set to NULL. You should not release the string without first retaining it.
A result code. See “Core Printing Result Codes.”
Page format objects can be created a number of different ways and some of them do not require a specific printer. If the printer ID is known, the printer is displayed in the Page Setup dialog’s Format for pop-up menu. If the printer ID is not known, the default formatting printer is the generic Any Printer. The printing system provides default page and paper sizes for the generic printer.
PMCore.hCreates a custom paper object.
OSStatus PMPaperCreateCustom ( PMPrinter printer, CFStringRef id, CFStringRef name, double width, double height, const PMPaperMargins *margins, PMPaper *paperP );
A printer for which the specified paper size is appropriate.
A unique identifier for this custom paper. For example, you could create a UUID string and use it as the unique identifier.
The name to display to the user for this custom 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 custom paper object. You are responsible for releasing the paper object with the function PMRelease.
A result code. See “Core Printing Result Codes.”
This function creates a custom paper object appropriate for the specified printer. Custom papers are treated differently than built-in papers by the printing system. To obtain one of the available built-in papers for a given printer, you can use the function PMPrinterGetPaperList.
PMCore.hObtains the localized name for a given paper.
OSStatus PMPaperCreateLocalizedName ( PMPaper paper, PMPrinter printer, CFStringRef *paperName );
The paper whose localized name you want to obtain.
The printer for which the localization should be performed.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string that contains the localized name of the paper. This name is appropriate to display in the user interface. If an error occurs, the variable is set to NULL. You are responsible for releasing the string.
A result code. See “Core Printing Result Codes.”
Not all printers have the same way of referring to a given paper. Generally, if you want to obtain the name of a paper, you want to localize the paper name for a particular printer. For example, if you were displaying a list of papers for a given printer, you would want the paper names to be localized for that printer.
In Mac OS X v10.5 and later, Apple recommends using this function instead of PMPaperGetName.
PMCore.hObtains the height of the sheet of paper represented by a paper object.
OSStatus PMPaperGetHeight ( PMPaper paper, double *paperHeight );
The paper whose height you want to obtain.
A pointer to your double-precision variable. On return, the variable contains the height of the specified paper, in points.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains the identifier of a paper object.
OSStatus PMPaperGetID ( PMPaper paper, CFStringRef *paperID );
The paper whose identifier you want to obtain.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string containing the unique identifier for this paper. You should not release the string without first retaining it.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains the margins describing the unprintable area of the sheet represented by a paper object.
OSStatus PMPaperGetMargins ( PMPaper paper, PMPaperMargins *paperMargins );
The paper whose margins you want to obtain.
A pointer to your PMPaperMargins structure. On return, the structure contains the unprintable margins of the specified paper, in points. The four values in the structure specify the top, left, bottom, and right imageable area margins of the paper.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains the name for a given paper.
OSStatus PMPaperGetName ( PMPaper paper, CFStringRef *paperName );
The paper whose name you want to obtain.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string containing the name for this paper. This name identifies the paper in the user interface. You should not release the string without first retaining it.
A result code. See “Core Printing Result Codes.”
This function does not necessarily return a paper name that’s localized for a given printer. In Mac OS X v10.5 and later, instead of using this function, Apple recommends using the function PMPaperCreateLocalizedName.
PMCore.hObtains the PPD paper name for a given paper.
OSStatus PMPaperGetPPDPaperName ( PMPaper paper, CFStringRef *paperName );
The paper whose PPD paper name you want to obtain.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string that contains the PPD paper name for the specified paper. If an error occurs, the variable is set to NULL. You should not release the string without first retaining it.
A result code. See “Core Printing Result Codes.”
The Mac OS X printing system uses a PostScript Printer Description (PPD) file to describe a given printer and print queue for that printer. The PPD paper name is the name that uniquely identifies a given paper for the printer to which the paper corresponds. To obtain a list of papers for a given printer, use the function PMPrinterGetPaperList.
PMCore.hObtains the printer ID of the printer to which a given paper corresponds.
OSStatus PMPaperGetPrinterID ( PMPaper paper, CFStringRef *printerID );
The paper whose printer ID you want to obtain.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string that contains the printer ID for the specified paper. If an error occurs, the variable is set to NULL. You should not release the string without first retaining it.
A result code. See “Core Printing Result Codes.”
Not all papers have a printer ID associated with them. If the printer ID is known, the printer is displayed in the Page Setup dialog’s Format for pop-up menu. If the printer ID is not known, the default formatting printer is the generic Any Printer. The printing system provides default paper sizes for the generic printer.
PMCore.hObtains the width of the sheet of paper represented by a paper object.
OSStatus PMPaperGetWidth ( PMPaper paper, double *paperWidth );
The paper whose width you want to obtain.
A pointer to your double-precision variable. On return, the variable contains the width of the specified paper, in points.
A result code. See “Core Printing Result Codes.”
PMCore.hReturns a Boolean value indicating whether a specified paper is a custom paper.
Boolean PMPaperIsCustom ( PMPaper paper );
The paper you’re querying to determine whether it’s a custom paper.
If true, the specified paper is a custom paper; otherwise, false.
You can create a custom paper with the function PMPaperCreateCustom.
PMCore.hObtains the localized name for a preset.
OSStatus PMPresetCopyName ( PMPreset preset, CFStringRef *name );
The preset object whose localized name you want to obtain. You can use the function PMPrinterCopyPresets to obtain the presets for a given printer.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string containing the localized name of the specified preset. You are responsible for releasing the string.
A result code. See “Core Printing Result Codes.”
PMCore.hCreates a print settings object with settings that correspond to a preset.
OSStatus PMPresetCreatePrintSettings ( PMPreset preset, PMPrintSession session, PMPrintSettings *printSettings );
The preset whose settings you want to obtain. You can use the function PMPrinterCopyPresets to obtain the presets for a given printer.
The session you use to present the Print dialog.
A pointer to your PMPrintSettings variable. On return, the variable refers to a print settings object with settings that correspond to the specified preset. You are responsible for releasing the print settings object with the function PMRelease.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains the attributes of a preset.
OSStatus PMPresetGetAttributes ( PMPreset preset, CFDictionaryRef *attributes );
The preset whose attributes you want to obtain. You can use the function PMPrinterCopyPresets to obtain the presets for a given printer.
A pointer to your CFDictionaryRef variable. On return, the variable refers to a Core Foundation dictionary containing the attributes of the specified preset, or NULL if the attributes could not be obtained. For more information about these attributes, see the Discussion. You should not release this dictionary without first retaining it.
A result code. See “Core Printing Result Codes.”
A preset has associated with it a dictionary containing the preset identifier, the localized name, and a description of the environment for which the preset is intended. In addition to these standard attributes, the preset you specify may contain additional attributes that reflect custom print settings.
PMCore.hObtains the URL of the description file for a given printer.
OSStatus PMPrinterCopyDescriptionURL ( PMPrinter printer, CFStringRef descriptionType, CFURLRef *fileURL );
The printer whose description file you want to obtain.
A constant that specifies the desired printer description file type. Currently, you must pass the constant kPMPPDDescriptionType.
A pointer to your CFURLRef variable. On return, the variable refers to a Core Foundation URL that specifies the location of the file that contains a description of the specified printer. You are responsible for releasing the URL. If an error occurs, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
You can use this function to locate the PostScript printer description (PPD) file for a printer.
PMCore.hObtains the device URI of a given printer.
OSStatus PMPrinterCopyDeviceURI ( 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 Core Foundation URL that specifies the printer's device URI. You are responsible for releasing the URL. If an error occurs, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
The device URI of a printer describes how to communicate with the device. For some devices, it also includes a unique identifier for the device.
PMCore.hObtains the name of the server hosting the print queue for a given printer.
OSStatus PMPrinterCopyHostName ( PMPrinter printer, CFStringRef *hostNameP );
The printer whose print queue host name you want to obtain.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string containing the name of the specified printer’s server. You are responsible for releasing the string.
A result code. See “Core Printing Result Codes.”
This function is typically used to obtain the name of the computer that hosts a shared printer, possibly for display in a user interface. In Mac OS X v10.5 and later, the typical way that users browse and communicate with a shared printer creates a local print queue and PMPrinterCopyHostName for such a print queue will return the name of the local host.
PMCore.hObtains a list of print settings presets for a printer.
OSStatus PMPrinterCopyPresets ( PMPrinter printer, CFArrayRef *presetList );
The printer whose presets you want to obtain.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array containing the presets for the specified printer. Each element in the array is an object of type PMPreset. You are responsible for releasing the array.
A result code. See “Core Printing Result Codes.”
A printer may have associated with it a list of preset settings. Each setting is optimized for a particular printing situation. This function returns all of the presets for a given printer. To obtain more information about a particular preset, you can use the function PMPresetGetAttributes. To create a print settings object that contains the settings of a preset, call PMPresetCreatePrintSettings.
PMCore.hCreates a printer object from a print queue identifier.
PMPrinter PMPrinterCreateFromPrinterID ( CFStringRef printerID );
The unique identifier of a print queue.
A new printer object, or NULL if no print queue is available with the specified identifier. You are responsible for releasing the printer object with the function PMRelease.
This function is typically used to re-create a printer object using the print queue ID obtained by a call to PMPrinterGetID at an earlier time. If the print queue is deleted after obtaining the ID, this function returns NULL for that ID.
PMCore.hObtains information about the communication channel for a printer.
OSStatus PMPrinterGetCommInfo ( PMPrinter printer, Boolean *supportsTransparentP, Boolean *supportsEightBitP );
The printer whose information you want to obtain.
A pointer to your Boolean variable. On return, true indicates that the communication channel to the specified printer supports bytes in the range 0x0–0x1F; otherwise, false.
A pointer to your Boolean variable. On return, true indicates that the communication channel to the specified printer supports bytes in the range 0x80–0xFF; otherwise, false.
A result code. See “Core Printing Result Codes.”
This function is typically relevant only to PostScript printers. All PostScript printers, regardless of what communications channel is used to send data to them, support data in the range 0x20–0x7F. Many communications channels can support data outside this range. You can use this function to determine whether the communications channel to the specified printer also supports bytes in the ranges 0x0–0x1F and 0x80–0xFF.
PMCore.h
Obtains the creator of the driver associated with the specified printer.
OSStatus PMPrinterGetDriverCreator ( PMPrinter printer, OSType *creator );
The printer whose driver creator you want to obtain.
On return, the 4-byte creator code of the driver (for example, 'APPL' for an Apple printer driver).
A result code. See “Core Printing Result Codes.”
This function is not recommended because it makes your application driver-dependent.
PMCore.h
Obtains version information for the driver associated with the specified printer.
OSStatus PMPrinterGetDriverReleaseInfo ( PMPrinter printer, VersRec *release );
The printer whose driver version you want to obtain.
A pointer to your VersRec data structure. On return, the structure contains the driver’s short and long version strings and country code.
A result code. See “Core Printing Result Codes.”
This function is not recommended because it makes your application driver-dependent. If you do use this function, you must call it between the creation and release of a printing session. See the function PMCreateSession.
PMCore.hReturns the unique identifier of a printer.
CFStringRef PMPrinterGetID ( PMPrinter printer );
The printer whose identifier you want to obtain.
The identifier of the specified printer. You should not release the string without first retaining it. If the specified printer is not valid, this function returns NULL.
You can use the function PMPrinterGetID to capture information about a printer for later use. To create a printer object from a printer ID returned by this function, use the function PMPrinterCreateFromPrinterID.
PMCore.h
Obtains a resolution setting based on an index into the range of settings supported by the specified printer.
OSStatus PMPrinterGetIndexedPrinterResolution ( PMPrinter printer, UInt32 index, PMResolution *resolutionP );
The printer whose resolution you want to obtain.
An index into the range of resolution settings supported by the specified printer. Index values begin at 1.
A pointer to your PMResolution data structure. On return, the structure contains the printer resolution setting associated with the index value.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of a printing session. Before you call this function, you must call the function PMPrinterGetPrinterResolutionCount to obtain the number of resolution settings supported by the specified printer.
PMCore.h
Obtains information about the imaging language for the specified printer.
OSStatus PMPrinterGetLanguageInfo ( PMPrinter printer, PMLanguageInfo *info );
The printer whose imaging language information you want to obtain.
A pointer to your PMLanguageInfo data structure. On return, the structure contains the printer’s language level, version, and release information. The format of the returned data uses the syntax of the PostScript language.
A result code. See “Core Printing Result Codes.”
The function PMPrinterGetLanguageInfo is useful only for PostScript printers. You must call this function between the creation and release of a printing session.
PMCore.hReturns the location of a printer.
CFStringRef PMPrinterGetLocation ( PMPrinter printer );
The printer whose location you want to obtain.
The location of the specified printer. You should not release the string without first retaining it. If the printer is not valid, this function returns NULL.
The location of a printer is specified when a user creates a print queue for the printer. In some cases, the printing system automatically determines the location. For example, the location may be set to “Local Zone”. The user creating the print queue can also set the location.
PMCore.hObtains the manufacturer and model name of the specified printer.
OSStatus PMPrinterGetMakeAndModelName ( PMPrinter printer, CFStringRef *makeAndModel );
The printer whose manufacturer and model name you want to obtain.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string containing the manufacturer and model name of the specified printer. You should not release the string without first retaining it. If an error occurs, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains a list of MIME content types supported by a printer using the specified print settings.
OSStatus PMPrinterGetMimeTypes ( PMPrinter printer, PMPrintSettings settings, CFArrayRef *mimeTypes );
The printer whose supported MIME types you want to obtain.
The print settings for the print job. The print settings object contains the job destination, which affects the available types. This parameter may be NULL.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array containing the MIME types supported by the specified printer. Each element in the array is a Core Foundation string. You should not release the array without first retaining it.
A result code. See “Core Printing Result Codes.”
This function retrieves the types of data that can be submitted to a printer with the specified print settings; for example, application/pdf. This function is typically used in conjunction with the function PMPrinterPrintWithFile.
PMCore.hReturns the human-readable name of a printer.
CFStringRef PMPrinterGetName ( PMPrinter printer );
The printer whose name you want to obtain.
The name of the specified printer. This name identifies the printer in the user interface. You should not release the string without first retaining it.
PMCore.hObtains the printer hardware output resolution for the specified print settings.
OSStatus PMPrinterGetOutputResolution ( PMPrinter printer, PMPrintSettings printSettings, PMResolution *resolutionP );
The printer whose output resolution you want to obtain.
The print settings you want to use.
A pointer to your PMResolution structure. On return, the structure contains the output resolution of the specified printer in pixels per inch.
A result code. If the resolution cannot be reliably determined, this function returns an error.
Some printers allow programmatic control of their hardware output resolution on a print job basis. The hardware resolution is determined by the combination of printer and print settings used for the print job. This function returns the best guess as to what printer resolution setting will be used for the destination print job.
Most applications do not need to use this function because they draw the same content regardless of the destination device. For those few applications that do adjust their drawing based on the output device, they should only do so when the print job destination is kPMDestinationPrinter or kPMDestinationFax. You can use the function PMSessionGetDestinationType to determine the destination for a print job.
This function should be used after displaying the Print dialog to the user so that it correctly reflects changes in print settings performed prior to printing.
PMCore.hObtains the list of papers available for a printer.
OSStatus PMPrinterGetPaperList ( PMPrinter printer, CFArrayRef *paperList );
The printer whose paper list you want to obtain.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array containing the paper list for the specified printer. Each element in the array is an object of type PMPaper. You should not release the array without first retaining it.
A result code. See “Core Printing Result Codes.”
This function obtains a list of the papers that a given printer claims to support. The paper list does not include any custom paper sizes that may be available.
PMCore.h
Obtains the number of resolution settings supported by the specified printer.
OSStatus PMPrinterGetPrinterResolutionCount ( PMPrinter printer, UInt32 *countP );
The printer whose number of resolution settings you want to obtain.
A pointer to your UInt32 variable. On return, the variable contains the number of resolutions that are supported for the specified printer.
A result code. The result code kPMNotImplemented indicates that the printer driver does not support multiple resolution settings.
PMCore.hObtains the current state of the print queue for a printer.
OSStatus PMPrinterGetState ( PMPrinter printer, PMPrinterState *state );
The printer whose queue state you want to obtain.
A pointer to your PMPrinterState variable. On return, the variable contains a constant that indicates the current state of the print queue for the specified printer. Supported values are:
kPMPrinterIdle (queue is idle)
kPMPrinterProcessing (queue is processing a job)
kPMPrinterStopped (queue is stopped)
See “Print Queue States” for a complete description of these constants.
A result code. See “Core Printing Result Codes.”
PMCore.hReturns a Boolean value indicating whether a printer is the default printer for the current user.
Boolean PMPrinterIsDefault ( PMPrinter printer );
The printer you’re querying to determine whether it is the default printer.
If true, the specified printer is the default printer for the current user; otherwise, false.
The default printer is the printer selected by default in the Print dialog.
PMCore.hReturns a Boolean value indicating whether a printer is in the user’s list of favorite printers.
Boolean PMPrinterIsFavorite ( PMPrinter printer );
The printer you’re looking for in the favorite printer list.
If true, the specified printer is in the user’s list of favorite printers; otherwise, false.
PMCore.hReturns a Boolean value indicating whether a printer is PostScript capable.
Boolean PMPrinterIsPostScriptCapable ( PMPrinter printer );
The printer you’re querying to determine whether it’s PostScript capable.
If true, the specified printer is a PostScript capable printer; otherwise, false.
A printer that is PostScript capable is not necessarily a PostScript printer. The Mac OS X printing system can render PostScript content on non-PostScript printers.
PMCore.hDetermines whether a printer is a PostScript printer.
OSStatus PMPrinterIsPostScriptPrinter ( PMPrinter printer, Boolean *isPSPrinter );
The printer you’re querying to determine whether it’s a PostScript printer.
A pointer to your Boolean variable. On return, true indicates that the specified printer is a PostScript printer; otherwise, false.
A result code. See “Core Printing Result Codes.”
A printer is a PostScript printer if the printer driver takes PostScript directly.
PMCore.hIndicates whether a printer is hosted by a remote print server.
OSStatus PMPrinterIsRemote ( PMPrinter printer, Boolean *isRemoteP );
The printer you’re querying to determine whether it is hosted by a remote print server.
A pointer to your Boolean variable. On return, true indicates that the printer is hosted by a remote print server; otherwise, false.
A result code. See “Core Printing Result Codes.”
If this function returns true, the printer is hosted by a remote print server and the printer can be considered a shared printer.
In Mac OS X, the typical way that users create a print queue for a shared printer is by browsing. Print queues for shared printers that are created by browsing are marked as remote queues, and PMPrinterIsRemote returns true for such printers. However, expert users can create a local queue for a remote printer manually, and such a printer does not appear to be remote printer.
Whether a printer is remote is derived from the CUPS printer-type attribute for the print queue.
PMCore.hSubmits a print job to a specified printer using a file that contains print data.
OSStatus PMPrinterPrintWithFile ( PMPrinter printer, PMPrintSettings settings, PMPageFormat format, CFStringRef mimeType, CFURLRef fileURL );
The destination printer.
The print settings for the print job.
The physical page size and orientation with which the document should be printed. This parameter can be NULL.
The MIME type of the data to be printed. If this parameter is NULL, the MIME type will be determined automatically. You can obtain a list of the MIME types supported by a given printer using the function PMPrinterGetMimeTypes.
The URL of the file that supplies the print data.
A result code. See “Core Printing Result Codes.” If the specified printer cannot handle the file's MIME type, a non-zero error code is returned.
This function can fail if the specified printer cannot handle the file’s MIME type. Use the function PMPrinterGetMimeTypes to check whether a MIME type is supported.
PMCore.hSubmits a print job to a specified printer using a Quartz data provider to obtain the print data.
OSStatus PMPrinterPrintWithProvider ( PMPrinter printer, PMPrintSettings settings, PMPageFormat format, CFStringRef mimeType, CGDataProviderRef provider );
The destination printer.
The print settings for the print job.
The physical page size and orientation with which the document should be printed. This parameter can be NULL.
The MIME type of the data to be printed. This parameter cannot be NULL. If you want automatic typing, use the function PMPrinterPrintWithFile instead. You can obtain a list of the MIME types supported by a given printer using the function PMPrinterGetMimeTypes.
The data provider that supplies the print data.
A result code. See “Core Printing Result Codes.”
This function can fail if the specified printer cannot handle the data provider’s MIME type. Use the function PMPrinterGetMimeTypes to check whether a MIME type is supported.
In Mac OS X v10.4 and earlier, this function is not implemented and returns the error code –1 when called. You can write your print data to a file and use PMPrinterPrintWithFile instead.
PMCore.hSets the default printer for the current user.
OSStatus PMPrinterSetDefault ( PMPrinter printer );
The printer to set as the default printer.
A result code. See “Core Printing Result Codes.”
The default printer is the printer selected by default in the Print dialog.
This function is rarely used. Most applications do not set the default printer directly, but instead let the user choose the default printer in the Print & Fax preference pane of System Preferences.
PMCore.hSets the print settings to reflect the specified printer hardware output resolution.
OSStatus PMPrinterSetOutputResolution ( PMPrinter printer, PMPrintSettings printSettings, const PMResolution *resolutionP );
The printer whose output resolution you want to change.
The print settings object used for the print job.
A pointer to a PMResolution structure that specifies the desired resolution in pixels per inch.
A result code. See “Core Printing Result Codes.”
Some printers allow programmatic control of their hardware output resolution on a print job basis. The hardware resolution is determined by the combination of printer and print settings used for the print job. This function configures the print settings to the closest resolution setting that can be used for the destination print job. Note that not all printers allow control of their resolution setting.
This function is rarely used. Most applications do not set the output resolution but instead use the setting supplied by the user in the Print dialog.
PMCore.hConverts an input file of the specified MIME type to printer-ready PostScript for a destination printer.
OSStatus PMPrinterWritePostScriptToURL ( PMPrinter printer, PMPrintSettings settings, PMPageFormat format, CFStringRef mimeType, CFURLRef sourceFileURL, CFURLRef destinationFileURL );
The destination printer for which printer-ready PostScript will be generated.
The print settings for the print job.
The page format specifying the physical page size and orientation on which the document should be printed.
The MIME type of the file to be printed. If you pass NULL, the file is typed automatically. You can obtain a list of the MIME types supported by a given printer using the function PMPrinterGetMimeTypes.
A URL specifying the input file to be converted to printer-ready PostScript data. Only file-based URLs are supported.
A URL specifying the destination file to be created. If the file already exists, it will be overwritten. Only file-based URLs are supported.
A result code. If the printing system cannot convert the input MIME type to PostScript, this function fails and returns an error.
This function is synchronous; the conversion of the input file to PostScript is performed before the function returns. This can take a significant amount of time for longer documents. You may want to perform this operation on a thread other than the main application thread or fork a separate process for this purpose.
PMCore.hCreates a dictionary that contains the settings in a print settings object.
OSStatus PMPrintSettingsCopyAsDictionary ( PMPrintSettings printSettings, CFDictionaryRef *settingsDictionary );
The print settings object with the desired settings.
A pointer to your CFDictionaryRef variable. On return, the variable refers to a Core Foundation dictionary that contains the settings in the specified print settings object. Some of the keys in this dictionary are currently defined in PMTicket.h; other keys are user-defined. You are responsible for releasing the dictionary. If an error occurs, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
Most developers have no need to use this function. However, one way this function might be useful would be to enumerate all the entries in a print settings object for inspection.
PMCore.hObtains the keys for items in a print settings object.
OSStatus PMPrintSettingsCopyKeys ( PMPrintSettings printSettings, CFArrayRef *settingsKeys );
The print settings object with the desired keys.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array that contains the keys for items in the specified print settings object. Each of these keys may be passed to the function PMPrintSettingsGetValue to obtain a value. You are responsible for releasing the array. If an error occurs, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
This function provides an array of the keys in a print settings object. You could get the values for the keys in the array with PMPrintSettingsGetValue, or use the keys to look up the values in the dictionary returned by PMPrintSettingsCopyAsDictionary.
PMCore.hCreates a data representation of a print settings object.
OSStatus PMPrintSettingsCreateDataRepresentation ( PMPrintSettings printSettings, CFDataRef *data, PMDataFormat format );
The print settings object to convert.
A pointer to your CFDataRef variable. On return, the variable refers to a new Core Foundation data object that contains a representation of the specified print settings object in the specified data format. You are responsible for releasing the data object.
A constant that specifies the format of the data representation. Supported values are:
kPMDataFormatXMLDefault (compatible with all Mac OS X versions)
kPMDataFormatXMLMinimal (approximately 3-5 times smaller; compatible with Mac OS X v10.5 and later)
kPMDataFormatXMLCompressed (approximately 20 times smaller; compatible with Mac OS X v10.5 and later)
See “Data Representation Formats” for a full description of these formats.
A result code. See “Core Printing Result Codes.”
This function is typically used to convert a print settings object into a data representation suitable for storage in a user document. For information about using a Core Foundation data object, see CFData Reference.
Before calling this function, you should call the function PMSessionValidatePrintSettings to make sure the print settings object contains valid values.
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.
PMCore.hCreates a print settings object from a data representation.
OSStatus PMPrintSettingsCreateWithDataRepresentation ( CFDataRef data, PMPrintSettings *printSettings );
The data representation of a print settings object. The data representation must have been previously created with the function PMPrintSettingsCreateDataRepresentation.
A pointer to your PMPrintSettings variable. On return, the variable refers to a new print settings object that contains the printing information stored in the specified data object. You are responsible for releasing the print settings object with the function PMRelease.
A result code. See “Core Printing Result Codes.”
This function is typically used to convert a data representation stored in a user document back into a print settings object. For information about creating a Core Foundation data object from raw data, see CFData Reference.
After calling this function, you should call the function PMSessionValidatePrintSettings to make sure the print settings object contains valid values.
PMCore.hObtains the name of a print job.
OSStatus PMPrintSettingsGetJobName ( PMPrintSettings printSettings, CFStringRef *name );
The print settings for the current print job.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string containing the name of the print job. This is the same job name you set using the function PMPrintSettingsSetJobName. You should not release the string without first retaining it.
A result code. See “Core Printing Result Codes.”
PMCore.hObtains the value of a setting in a print settings object.
OSStatus PMPrintSettingsGetValue ( PMPrintSettings printSettings, CFStringRef key, CFTypeRef *value );
The print settings object you want to access.
A string constant that specifies the key for the desired setting. Some keys are currently defined in PMTicket.h; other keys are user-defined.
A pointer to your Core Foundation variable. On return, the variable refers to a Core Foundation object that corresponds to the specified key. If no corresponding object exists, the variable is set to NULL.
A result code. See “Core Printing Result Codes.”
This function, together with the function PMPrintSettingsSetValue, makes it possible to access print settings directly.
PMCore.hSpecifies the name of a print job.
OSStatus PMPrintSettingsSetJobName ( 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.”
If you’re using the Print dialog, you should call this function before presenting the dialog. You are strongly encouraged to create a print job name that’s meaningful to the user and use this function to set the name; this produces the best user experience. If you do not specify the print job name, the printing system creates an appropriate job name for you.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCore.hStores the value of a setting in a print settings object.
OSStatus PMPrintSettingsSetValue ( PMPrintSettings printSettings, CFStringRef key, CFTypeRef value, Boolean locked );
The print settings object you want to update.
A string constant that specifies the key for the desired setting. Some keys are currently defined in PMTicket.h; other keys are user-defined.
A Core Foundation object that corresponds to the specified key. If you pass NULL, any existing setting for the specified key is removed.
If true, the item being set should be locked; otherwise, false. Currently, you should always pass false.
A result code. See “Core Printing Result Codes.”
This function makes it possible to add, change, or remove print settings directly. Print settings are stored as key-value pairs. The keys are Core Foundation strings and the corresponding values are Core Foundation objects.
You can use this function to store user-defined data in a print settings object. You should make sure that the custom keys you define for your private data do not conflict with any other keys in the object. Each data item you store needs to be a Core Foundation object. You can use the function PMPrintSettingsGetValue to retrieve your private data.
If you call this function after initiating a print job (for example, by calling PMSessionBeginCGDocument), the change is ignored for the current job.
PMCore.hConverts print settings into a CUPS options string.
OSStatus PMPrintSettingsToOptions ( PMPrintSettings settings, char **options );
The print settings to convert.
A pointer to a C string. On return, a CUPS options string describing the print settings, or NULL if the print settings could not be converted. The function allocates storage for the string. You are responsible for freeing the storage.
A result code. See “Core Printing Result Codes.”
This function creates a CUPS options string that captures the data in the specified print settings object. In Mac OS X v10.5 and later, Apple recommends that you use the PMPrintSettingsToOptionsWithPrinterAndPageFormat function instead.
PMCore.hConverts print settings and page format data into a CUPS options string for a specified printer.
OSStatus PMPrintSettingsToOptionsWithPrinterAndPageFormat ( PMPrintSettings settings, PMPrinter printer, PMPageFormat pageFormat, char **options );
The print settings to convert.
The printer to use for converting the print settings. This parameter must not be NULL.
The page format to convert, or NULL to specify default page format data.
A pointer to a C string. On return, a CUPS option string with the specified print settings and page format data, or NULL if the data could not be converted. The function allocates storage for the string. You are responsible for freeing the storage.
A result code. See “Core Printing Result Codes.”
This function creates a CUPS options string for the destination printer that captures the data in the specified print settings and page format objects. For example, you could pass this string to the function PMWorkflowSubmitPDFWithOptions to submit a PDF file for workflow processing. You could also use the options string to run a CUPS filter directly.
PMCore.h
Releases a printing object by decrementing its reference count.
OSStatus PMRelease ( PMObject object );
The printing object you want to release.
A result code. See “Core Printing Result Codes.”
Your application should use the PMRelease function to release any printing objects it creates or retains. When an object’s reference count reaches 0, the object is deallocated.
For example, to terminate a printing session created with the function PMCreateSession, pass the associated PMPrintSession object to PMRelease. To release printing objects created with the functions PMCreatePageFormat and PMCreatePrintSettings, pass the associated PMPageFormat and PMPrintSettings objects to PMRelease.
PMCore.h
Retains a printing object by incrementing its reference count.
OSStatus PMRetain ( PMObject object );
The printing object you want to retain.
A result code. See “Core Printing Result Codes.”
You should retain a printing object when you receive it from elsewhere (that is, you did not create or copy it) and you want it to persist. If you retain a printing object, you are responsible for releasing it. (See PMRelease.) You can use the function PMRetain to increment a printing object’s reference count so that multiple threads or routines can use the object without the risk of another thread or routine deallocating the object.
PMCore.hCreates a list of printers available to a print server.
OSStatus PMServerCreatePrinterList ( PMServer server, CFArrayRef *printerList );
The print server whose printers you want to obtain. To specify the local print server, pass the constant kPMServerLocal. Currently, you may specify only the local print server.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array containing the printers available to the specified print server. Each element in the array is a PMPrinter object. You are responsible for releasing the array.
A result code. See “Core Printing Result Codes.”
PMCore.hLaunches the printer browser to browse the printers available for a print server.
OSStatus PMServerLaunchPrinterBrowser ( PMServer server, CFDictionaryRef options );
The print server to browse. Pass kPMServerLocal to specify the local print server. Currently, you may specify only the local print server.
This parameter is reserved for future use. At the present time, pass NULL. Passing NULL presents the printer browser in the default fashion.
A result code. See “Core Printing Result Codes.” If you specify a server whose printers cannot be browsed, this function returns the error code kPMInvalidParameter.
This function displays the standard printer browser to allow the user to create a new print queue.
PMCore.hBegins a print job that draws into a Quartz graphics context and suppresses the printing status dialog.
OSStatus PMSessionBeginCGDocumentNoDialog ( 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.”
This function starts a print job that draws directly into a Quartz graphics context and should be called within your application’s print loop. This function is similar to the function PMSessionBeginCGDocument except that the printing status dialog is suppressed.
You must call PMSessionBeginCGDocumentNoDialog between the creation and release of a printing session. See the function PMCreateSession. If you present a printing dialog before you call PMSessionBeginCGDocumentNoDialog, when calling this function you should use the same PMPrintSession object you used to present the dialog.
Before you call PMSessionBeginCGDocumentNoDialog, you should call PMSessionValidatePrintSettings and PMSessionValidatePageFormat to make sure the specified print settings and page format objects are updated and valid. After you call PMSessionBeginCGDocumentNoDialog, if you call a function that changes the specified print settings or page format object, the change is ignored for the current print job.
During the print job, the caller cannot obtain a Quickdraw graphics port for the printing session but can only obtain a Quartz graphics context. As a result, this function should be used in conjunction with PMSessionGetCGGraphicsContext instead of PMSessionGetGraphicsContext.
This function must be called before its corresponding End function (PMSessionEndDocumentNoDialog). If the function PMSessionBeginCGDocumentNoDialog returns noErr, you must later 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.
PMCore.hStarts a new page for printing in the specified printing session and suppresses the printing status dialog.
OSStatus PMSessionBeginPageNoDialog ( PMPrintSession printSession, PMPageFormat pageFormat, const PMRect *pageFrame );
The printing session that provides a context for the print job.
The page format for the new page. If you pass NULL, the printing system uses the page format you passed to PMSessionBeginCGDocumentNoDialog.
You should pass NULL, as this parameter is currently unsupported.
A result code. If the user cancels the print job, this function returns kPMCancel.
This function is similar to the function PMSessionBeginPage except that the function PMSessionBeginPageNoDialog suppresses the printing status dialog. You must call this function between the creation and release of a printing session. See the function PMCreateSession. You must call the functions PMSessionBeginPageNoDialog and PMSessionEndPageNoDialog within the scope of calls to the Begin print job function (PMSessionBeginCGDocumentNoDialog) and the End print job function (PMSessionEndDocumentNoDialog).
You should call the function PMSessionError immediately before you call PMSessionBeginPageNoDialog. If PMSessionError returns an error, then you should not call the function PMSessionBeginPageNoDialog. Because PMSessionBeginPage also initializes the printing graphics context, your application should not make assumptions about the state of the context (for example, the current font) between successive pages. After each call to PMSessionBeginPageNoDialog, your application should call PMSessionGetCGGraphicsContext to obtain the current printing context.
If the function PMSessionBeginPageNoDialog returns noErr, you must later call the function PMSessionEndPageNoDialog, even if errors occur within the scope of PMSessionBeginPageNoDialog and PMSessionEndPageNoDialog.
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.
Prior to Mac OS X v10.5, the pageFormat parameter is ignored. In Mac OS X v10.5 and later, the printing system supports multiple orientations within a print job. When you call this function and supply a page format, the orientation specified in the page format is used for the current page. Other settings in the page format, such as paper size or scaling, are ignored.
PMCore.hObtains the destination format for a print job.
OSStatus PMSessionCopyDestinationFormat ( PMPrintSession printSession, PMPrintSettings printSettings, CFStringRef *destFormatP );
The printing session that provides a context for the print job.
The print settings object for the print job whose destination format you want to obtain.
A pointer to your CFStringRef variable. On return, the variable refers to a Core Foundation string that contains the destination format for the print job. You are responsible for releasing the string. Currently, there are two possible values: kPMDocumentFormatPDF or kPMDocumentFormatPostScript.
If an error occurs, the variable is set to NULL. If the function executes without error and the variable is set to NULL, the print job is set to use the default destination format.
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.
PMCore.hObtains a destination location for a print job.
OSStatus PMSessionCopyDestinationLocation ( PMPrintSession printSession, PMPrintSettings printSettings, CFURLRef *destLocationP );
The printing session that provides a context for the print job.
The print settings for the print job whose destination location you want to obtain.
A pointer to your CFURLRef variable. On return, the variable refers to a Core Foundation URL that specifies the destination location of the print job. You are responsible for releasing the URL. If NULL is returned and the function executes without error (result code is noErr), the print job uses the default destination location for the current destination type. If an error occurs, the variable is set to NULL.
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.
Some destination types define a specific kind of destination location for a print job. For example, the destination type kPMDestinationFile uses a file system URL to specify where a new file should be created for the print job’s output.
PMCore.hObtains an array of destination formats supported by the current print destination.
OSStatus PMSessionCopyOutputFormatList ( PMPrintSession printSession, PMDestinationType destType, CFArrayRef *documentFormatP );
The printing session that provides a context for the print job. The printer associated with this session is queried for the MIME types it supports.
A destination type that specifies the destination for which you want to obtain valid destination formats. See “Destination Types” for a list of the possible destination types a print job can have.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array that contains a list of destination formats that can be generated for the current print destination. See “Document Format Strings” for a list of some of the output formats that can be returned.
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.
PMCore.hObtains a list of page format objects, each of which describes a paper size available on the specified printer.
OSStatus PMSessionCreatePageFormatList ( PMPrintSession printSession, PMPrinter printer, CFArrayRef *pageFormatList );
The current printing session.
The printer whose list of page sizes you want to enumerate.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array that contains the page format (PMPageFormat) objects associated with the specified printer. You are responsible for releasing the array. Each page format object describes a paper size available for the specified printer. If the function fails, then on return the array is NULL.
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 this function to find the available sheet sizes (and the imageable area for them) for a given printer. After you obtain the page format list, you can call the function PMGetUnadjustedPaperRect for each page format object in the list to obtain the sheet rectangle size. Once you find the paper size you want, call PMGetUnadjustedPageRect to obtain the imageable area for that paper size.
PMCore.h
Creates a list of printers available in the specified printing session.
OSStatus PMSessionCreatePrinterList ( PMPrintSession printSession, CFArrayRef *printerList, CFIndex *currentIndex, PMPrinter *currentPrinter );
The printing session whose printer list you want to obtain.
A pointer to your CFArrayRef variable. On return, the variable refers to a Core Foundation array containing a list of printers available in the specified printing session. Each element in the array is a Core Foundation string that contains a printer’s name as shown in the user interface. You are responsible for releasing the array.
A pointer to your CFIndex variable. On return, the variable contains a value specifying where the current printer is in the printer list.
A pointer to your PMPrinter variable. On return, the variable refers to a printer object that represents the current printer. You should not release the printer object without first retaining it. If the printer is the generic printer, the variable is set to NULL.
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 call the function PMSessionCreatePrinterList to obtain a valid printer name to pass to the function PMSessionSetCurrentPrinter.
In Mac OS X v10.2 and later, Apple recommends using the function PMServerCreatePrinterList instead. PMServerCreatePrinterList doesn’t require a PMSession object; it can be called at any time. It also works directly with PMPrinter objects.
PMCore.h
Assigns default parameter values to a page format object used in the specified printing session.
OSStatus PMSessionDefaultPageFormat ( PMPrintSession printSession, PMPageFormat pageFormat );
The printing session for the specified page format object.
The page format object to which you want to assign default values.
A result code. See “Core Printing Result Codes.”
You must call the function PMSessionDefaultPageFormat between the creation and release of the printing session. See the function PMCreateSession.
PMCore.h
Assigns default parameter values to a print settings object for the specified printing session.
OSStatus PMSessionDefaultPrintSettings ( PMPrintSession printSession, PMPrintSettings printSettings );
The printing session for the specified print settings object.
The print settings object to which you want to assign default values.
A result code. See “Core Printing Result Codes.”
You must call the function PMSessionDefaultPrintSettings between the creation and release of a printing session. See the function PMCreateSession.
PMCore.hEnds a print job started by calling the function PMSessionBeginCGDocumentNoDialog or PMSessionBeginDocumentNoDialog.
OSStatus PMSessionEndDocumentNoDialog ( PMPrintSession printSession );
The current printing session. On return, the printing session is no longer valid; however, you must still call the function PMRelease to release the object.
A result code. See “Core Printing Result Codes.”
This function is similar to the function PMSessionEndDocument except that the printing status dialog is suppressed.
This function is used to end a print job, and it should be called within your application’s print loop after the call to the function PMSessionEndPageNoDialog and before releasing the printing session. The same printing session that is created by the function PMCreateSession for the Print dialog should be used for the print loop.
The function PMSessionEndDocumentNoDialog must be called after its corresponding Begin function (PMSessionBeginCGDocumentNoDialog or PMSessionBeginDocumentNoDialog). If the Begin function returns noErr, the function PMSessionEndDocument must be called, even if errors occur within the scope of the Begin and End functions. You should not call PMSessionEndDocumentNoDialog if the Begin function returns an error.
PMCore.hIndicates the end of drawing the current page for the specified printing session.
OSStatus PMSessionEndPageNoDialog ( PMPrintSession printSession );
The printing session that provides a context for the print job.
A result code. See “Core Printing Result Codes.”
This function is similar to the function PMSessionEndPage 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. You must call the functions PMSessionBeginPageNoDialog and PMSessionEndPageNoDialog within the scope of calls to the Begin print job function (PMSessionBeginCGDocumentNoDialog) and the End print job function (PMSessionEndDocumentNoDialog).
If the function PMSessionBeginPageNoDialog returns noErr, you must later call the function PMSessionEndPageNoDialog, even if errors occur within the scope of PMSessionBeginPageNoDialog and PMSessionEndPageNoDialog. You should not call PMSessionEndPageNoDialog if PMSessionBeginPageNoDialog returns an error.
PMCore.h
Obtains the result code for any error returned by the printing session.
OSStatus PMSessionError ( PMPrintSession printSession );
The printing session whose last error you want to obtain.
A result code. See “Core Printing Result Codes.” The constant kPMCancel indicates the user canceled the current print job.
You must call this function between the creation and release of a printing session. See the function PMCreateSession.
The PMSessionError function returns the last printing session error, not the last error from a printing function (PMxxx). Because most printing functions return a result code, the PMSessionError function is not required for general error checking. However, you can use PMSessionError in your print loop to determine if the user cancels the current print job or if any other errors occur during printing that are not explicitly returned by one of the other calls. For example, if the user clicks the Cancel button in the status dialog or presses Command-period on the keyboard, this function returns the constant kPMCancel. If this or any other error is encountered during the print loop, your application should call the appropriate functions (for example, PMSessionEndPage and PMSessionEndDocument) to exit the print loop before your application reports the error.
PMCore.hObtains the Quartz graphics context for the current page in a printing session.
OSStatus PMSessionGetCGGraphicsContext ( PMPrintSession printSession, CGContextRef *context );
The printing session whose Quartz graphics context you want to obtain.
A pointer to your CGContextRef variable. On return, the variable refers to the Quartz graphics context for the current page in the specified printing session. The context’s origin is at the lower-left corner of the sheet of paper, not the imageable area. You should not release the context without first retaining it. The context is valid only for the current page; you should not retain it beyond the end of the page.
A result code. See “Core Printing Result Codes.”
If you’re using Quartz 2D to draw the content for a print job, after each call to PMSessionBeginPage you should call PMSessionGetCGGraphicsContext to obtain the Quartz graphics context for the current page. Note that before you can use the function PMSessionGetCGGraphicsContext, you must have called PMSessionBeginCGDocument or PMSessionBeginCGDocumentNoDialog instead of PMSessionBeginDocument or PMSessionBeginDocumentNoDialog.
PMCore.h
Obtains the current printer associated with a printing session.
OSStatus PMSessionGetCurrentPrinter ( PMPrintSession printSession, PMPrinter *currentPrinter );
The printing session whose printer you want to obtain.
A pointer to your PMPrinter variable. On return, the variable refers to the printer associated with the specified printing session. The printer object is valid as long as the printing session is valid or the current printer hasn’t changed. You should not release this object without first retaining it.
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.
PMCore.h
Obtains application-specific data previously stored in a printing session object.
OSStatus PMSessionGetDataFromSession ( PMPrintSession printSession, CFStringRef key, CFTypeRef *data );
The printing session whose data you want to obtain.
The key that uniquely identifies the data to be retrieved. You specify this key when you store the data using the function PMSessionSetDataInSession.
A pointer to your CFTypeRef variable. On return, the variable refers to the data retrieved from the 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.
PMCore.hObtains the output destination for a print job.
OSStatus PMSessionGetDestinationType ( PMPrintSession printSession, PMPrintSettings printSettings, PMDestinationType *destTypeP );
The printing session that provides a context for the print job. This must be the same printing session used for the Print dialog. The printing session contains the preview setting, which can override the destination type in the print settings.
The print settings for the print job whose destination you want to obtain.
A pointer to your PMDestinationType variable. On return, the variable contains the destination type for the specified print job. Possible values include:
kPMDestinationPrinter (output to a printer)
kPMDestinationFile (output to a file)
kPMDestinationFax (output to a fax)
kPMDestinationPreview (output to print preview)
kPMDestinationProcessPDF (output to a PDF workflow option)
See “Destination Types” for a complete description of the destination type constants.
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.
All of the destination types are stored in the print settings object except for kPMDestinationPreview, which is stored in the printing session object. If the destination type is set as preview, the preview setting overrides the destination set in the print settings object.
PMCore.h
Changes the current printer for a printing session.
OSStatus PMSessionSetCurrentPMPrinter ( PMPrintSession session, PMPrinter printer );
The printing session whose printer you want to change.
The new printer for the 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.
PMCore.h
Stores your application-specific data in a printing session object.
OSStatus PMSessionSetDataInSession ( PMPrintSession printSession, CFStringRef key, CFTypeRef data );
The printing session in which you want to store application-specific data.
A key that uniquely identifies the data being added. This key is required to retrieve the data using the function PMSessionGetDataFromSession.
The data to be stored in the 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.
PMCore.hSets the destination location, format, and type for a print job.
OSStatus PMSessionSetDestination ( PMPrintSession printSession, PMPrintSettings printSettings, PMDestinationType destType, CFStringRef destFormat, CFURLRef destLocation );
The printing session that provides a context for the print job.
The print settings for the print job whose destination you want to set.
The destination type for the print job associated with the specified printing session and print settings. Possible values include:
kPMDestinationPrinter (output to a printer)
kPMDestinationFile (output to a file)
kPMDestinationFax (output to a fax)
kPMDestinationPreview (output to print preview)
kPMDestinationProcessPDF (output to a PDF workflow option)
See “Destination Types” for a complete description of destination types you can specify.
The MIME type to be generated for the specified destination type. Pass NULL if you want to use the default format for the specified destination type. To obtain a list of valid formats for a given destination type, use the function PMSessionCopyOutputFormatList.
A reference to a Core Foundation URL that specifies a destination location. You can provide this if the destination type supports a destination location. Otherwise, pass NULL. For example, if the destination type is a file (kPMDestinationFile) you can supply a file system URL to specify where the file resides.
A result code. See “Core Printing Result Codes.”
You can use the function PMSessionSetDestination when you want to send print output to a file without requiring user interaction. You must call this function between the creation and release of a printing session. See the function PMCreateSession.
PMCore.h
Sets the value of the current result code for the specified printing session.
OSStatus PMSessionSetError ( PMPrintSession printSession, OSStatus printError );
The printing session whose result code you want to set.
The result code you want to set. This result code is returned by the PMSessionError function.
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 this function to terminate a printing session if your application encounters any errors inside the print loop. Typically, this function is used by an application’s idle function. The idle function isn’t called in Mac OS X, so this usage is not available.
PMCore.h
Updates the values in a page format object and validates them against the current formatting printer.
OSStatus PMSessionValidatePageFormat ( PMPrintSession printSession, PMPageFormat pageFormat, Boolean *result );
The printing session for the specified page format object.
The page format object to validate.
A pointer to your Boolean variable. On return, true if the function set the page format object to default values; otherwise, false.
A result code. See “Core Printing Result Codes.”
You must call this function between the creation and release of the printing session. See the function PMCreateSession.
The function PMSessionValidatePageFormat validates the page format object against the current formatting printer. The formatting printer is displayed in the Format for pop-up menu in the Page Setup dialog. The default formatting printer is the generic Any Printer. If the page format object contains values that are not valid for the formatting printer, the page format object is set to default values and the result parameter is set to true.
Validating a page format object also causes calculated fields (such as the adjusted paper and page rectangles) to be updated based on the changed settings (such as resolution, scaling, and page orientation). If the page format object contains values that are valid for the formatting printer but need to be updated, the result parameter is set to false.
After you call any function that makes changes to a page format object (such as PMSetOrientation), you should call the function PMSessionValidatePageFormat to validate the page format object before using that object.
PMCore.h
Validates a print settings object within the context of the specified printing session.
OSStatus PMSessionValidatePrintSettings ( PMPrintSession printSession, PMPrintSettings printSettings, Boolean *result );
The printing session for the specified print settings object.
The print settings object to validate.
A pointer to your Boolean variable. On return, true if any parameters changed, or false if no parameters changed.
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.
PMCore.hSpecifies whether the job collate option is selected.
OSStatus PMSetCollate ( PMPrintSettings printSettings, Boolean collate );
The print settings object whose job collate option you want to set.
If true, the job collate option is selected; if false the option is not selected.
A result code. See “Core Printing Result Codes.”
The Collated checkbox is displayed in the Copies & Pages pane of the Print dialog. This option determines how printed material is organized. For example, if you have a document that is three pages long and you are printing multiple copies with the Collated option selected, the job prints pages 1, 2, and 3 in that order and then repeats. However, if the Collated option is not selected and you’re printing multiple copies of those same three pages, the job prints copies of page 1, then copies of page 2, and finally copies of page 3.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCore.h
Sets the initial value for the number of copies to be printed.
OSStatus PMSetCopies ( PMPrintSettings printSettings, UInt32 copies, Boolean lock );
The print settings object you want to initialize.
The initial value of the number of copies to print.
The lock state of the setting. Locking is not supported at this time.
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.
PMCore.hSets the duplex mode.
OSStatus PMSetDuplex ( PMPrintSettings printSettings, PMDuplexMode duplexSetting );
The print settings object whose duplex mode you want to set.
The new duplex mode setting. Possible values include:
kPMDuplexNone (one-sided printing)
kPMDuplexNoTumble (two-sided printing)
kPMDuplexTumble (two-sided printing with tumbling)
See “Duplex Modes” for a full description of the constants you can use to specify the new setting.
A result code. See “Core Printing Result Codes.”
Duplex printing is a print job that prints on both sides of the paper. Two-Sided printing controls are displayed in the Layout pane of the Print dialog. Note that not all printers support duplex printing. This function specifies a setting that might not be available on a given destination.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCore.h
Sets the default page number of the first page to be printed.
OSStatus PMSetFirstPage ( PMPrintSettings printSettings, UInt32 first, Boolean lock );
The print settings object whose first page number you want to set.
The page number of the first page to print. This value appears in the From field of the Print dialog.
The lock state of the setting. Locking is not supported at this time.
A result code. See “Core Printing Result Codes.”
Typically, this function isn’t used. In Mac OS X, if you call the function PMSetPageRange and then call PMSetFirstPage or PMSetLastPage using the same page range you specified for PMSetPageRange, then the Print dialog shows the From button selected. If you use the constant kPMPrintAllPages to set the page range with the function PMSetPageRange, then the Print dialog opens with the All button selected regardless of whether you also call PMSetFirstPage or PMSetLastPage.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCore.h
Sets the page number of the last page to be printed.
OSStatus PMSetLastPage ( PMPrintSettings printSettings, UInt32 last, Boolean lock );
The print settings object whose last page number you want to set.
The page number of the last page to print. This value appears in the To field of the Print dialog. Pass the constant kPMPrintAllPages to print the entire document.
The lock state of the setting. Locking is not supported at this time.
A result code. See “Core Printing Result Codes.”
Typically, you call this function after the Print dialog is displayed to indicate the number of the last page number to be printed. In Mac OS X, setting the last page provides information used by the progress dialog that is shown during printing.
If you call the function PMSetPageRange and then call PMSetFirstPage or PMSetLastPage using the same page range you specified for PMSetPageRange, then the Print dialog shows the From button selected. If you use the constant kPMPrintAllPages to set the page range with the function PMSetPageRange, then the Print dialog opens with the All button selected regardless of whether you also call PMSetFirstPage or PMSetLastPage.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCore.h
Sets the page orientation for printing.
OSStatus PMSetOrientation ( PMPageFormat pageFormat, PMOrientation orientation, Boolean lock );
The page format object whose page orientation you want to set.
A constant specifying the desired page orientation. Supported values are:
kPMPortrait
kPMLandscape
kPMReversePortrait (Mac OS X v10.5 and later)
kPMReverseLandscape
See “Page Orientation Constants” for a full description of the values you can use to specify page orientation.
The lock state of the setting. You should pass kPMUnlocked. Locking is not supported at this time.
A result code. See “Core Printing Result Codes.”
In Mac OS X 10.4 and earlier, if you want to set the page orientation you need to call this function before initiating the print job (for example, by calling PMSessionBeginCGDocument). The page orientation you set applies to the entire print job. In Mac OS X 10.5 and later, you can use this function to change the orientation of an individual page in a print job by passing the updated page format to PMSessionBeginPage or PMSessionBeginPageNoDialog.
PMCore.h
Stores your application-specific data in a page format object.
OSStatus PMSetPageFormatExtendedData ( PMPageFormat pageFormat, OSType dataID, UInt32 size, void *extendedData );
The page format object in which to store your extended data.
A 4-character code that identifies your data. This is typically your application’s creator code. If your creator code is outside the ASCII 7-bit character range 0x20–0x7F, you need to use a different 4-character code.
The size, in bytes, of the data to be stored in the page format object.
A pointer to the application-specific data you want to store in the page format object.
A result code. See “Core Printing Result Codes.”
You can retrieve the data you store with the function PMSetPageFormatExtendedData by calling the function PMGetPageFormatExtendedData.
PMCore.h
Sets the valid range of pages that can be printed.
OSStatus PMSetPageRange ( PMPrintSettings printSettings, UInt32 minPage, UInt32 maxPage );
The print settings object whose page range you want to set.
The minimum page number allowed. This value appears as the default in the From field of the Print dialog.
The maximum page number allowed. This value appears as the default in the To field of the Print dialog. Pass the constant kPMPrintAllPages to allow the user to print the entire document. If the first page is set to 1, then passing kPMPrintAllPages as the maximum page number causes the All button to be selected.
A result code. See “Core Printing Result Codes.”
The function PMSetPageRange allows applications to set the minimum and maximum page numbers that can be printed for a document. If the user enters a value outside of this range in the Print dialog, the value is set to the closest allowed value. You can use the PMGetFirstPage and PMGetLastPage functions to obtain the values entered by the user in the Print dialog.)
If you call the function PMSetPageRange to set the maximum page to a value other than the constant kPMPrintAllPages, the function PMSetPageRange causes the page range in the Print dialog to be properly restricted to the specified range. If you call the function PMSetPageRange without also calling the functions PMSetFirstPage or PMSetLastPage, then the Print dialog shows the specified page range in the From and To fields but with the All button selected. If you call the function PMSetPageRange and then call PMSetFirstPage or PMSetLastPage using the same page range you specified for PMSetPageRange, then the Print dialog shows the From button selected.
In all cases, if your application sets a range with PMSetPageRange and subsequently calls PMSetFirstPage or PMSetLastPage with values outside of the specified range, Core Printing returns a result code of kPMValueOutOfRange. Conversely, if your application calls PMSetPageRange after calling PMSetFirstPage or PMSetLastPage (or after displaying the Print dialog), the page range specified by PMSetPageRange takes precedence, and the first and last page values are adjusted accordingly.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCore.h
Stores your application-specific data in a print settings object.
OSStatus PMSetPrintSettingsExtendedData ( PMPrintSettings printSettings, OSType dataID, UInt32 size, void *extendedData );
The print settings object in which to store your application-specific data.
A 4-character code that will be used to identify your data. The 4-character code must not contain any characters outside the standard ASCII 7-bit character range 0x20–0x7F. This is typically your application’s creator code.
The size, in bytes, of the data to be stored in the print settings object.
A pointer to a buffer that contains the extended data you want to store.
A result code. See “Core Printing Result Codes.”
You can retrieve the data you store with the function PMSetPrintSettingsExtendedData by calling the function PMGetPrintSettingsExtendedData.
You may find it easier to use the functions PMPrintSettingsSetValue and PMPrintSettingsGetValue to store and retrieve user-defined data in a print settings object. If you use these functions, make sure that the custom keys you define for your private data do not conflict with other print settings keys.
PMCore.h
Sets the scaling factor for the page and paper rectangles.
OSStatus PMSetScale ( PMPageFormat pageFormat, double scale );
The page format object whose scaling factor you want to set.
The desired scaling factor expressed as a percentage. For example, for 50 percent scaling, pass a value of 50.0; for no scaling, pass 100.0.
A result code. See “Core Printing Result Codes.”
You can call the function PMSetScale to change the scaling factor that appears when your application invokes the Page Setup dialog.
If you call PMSetScale after calling PMSessionPageSetupDialog, make sure you call PMSessionValidatePageFormat before you call PMSessionBeginCGDocument or PMSessionBeginDocument.
If you call this function after initiating a print job, the change is ignored for the current job.
PMCore.hObtains an array of the available PDF workflow items.
OSStatus PMWorkflowCopyItems ( CFArrayRef *workflowItems );
A pointer to your CFArrayRef variable. On return, the variable refers to an Core Foundation array. Each element in the array is a dictionary that describes either a PDF workflow item or a folder containing a set of PDF workflow items. For a list of possible keys, see “PDF Workflow Dictionary Keys”. You are responsible for releasing the array.
A result code. See “Core Printing Result Codes.”
PMCore.hSubmits a PDF file for workflow processing using the specified CUPS options string.
OSStatus PMWorkflowSubmitPDFWithOptions ( CFURLRef workflowItem, CFStringRef title, const char *options, CFURLRef pdfFile );
A file system URL pointing to the workflow item that will handle the PDF file. See PMWorkflowCopyItems. The following table describes the different types of workflow items for this function.
Workflow item | Description |
|---|---|
Automator action | The action is executed for the PDF file. Available in Mac OS X v10.4 and later. |
Folder alias | The PDF file is moved to the resolved folder. |
Application or application alias | The application is sent an open event along with a reference to the PDF file. |
Compiled AppleScript | The script is run with an open event along with a reference to the PDF file. |
Executable tool | The tool is run with the following parameters: title, options, and pdfFile. |
The user-displayable name of the PDF document.
A string of CUPS-style key-value pairs that may be passed to the PDF workflow item. This parameter can be NULL in which case an empty string of options is used.
A file system URL pointing to the PDF file to be processed by the workflow item.
A result code. See “Core Printing Result Codes.”
The printing system uses this function in conjunction with the function PMWorkflowCopyItems to implement the PDF workflow button in the Print dialog.
PMCore.hSubmits a PDF file for workflow processing using the specified print settings.
OSStatus PMWorkflowSubmitPDFWithSettings ( CFURLRef workflowItem, PMPrintSettings settings, CFURLRef pdfFile );
A file system URL pointing to the workflow item that will handle the PDF file. See PMWorkflowCopyItems. The following table describes the different types of workflow items for this function.
Workflow item | Description |
|---|---|
Automator action | The action is executed for the PDF file. Available in Mac OS X v10.4 and later. |
Folder alias | The PDF file is moved to the resolved folder. |
Application or application alias | The application is sent an open event along with a reference to the PDF file. |
Compiled AppleScript | The script is run with an open event along with a reference to the PDF file. |
Executable tool | The tool is run with the specified settings and PDF file. This function converts these parameters into a CUPS options string and passes the options string to the tool. |
The print settings to apply to the PDF document. These settings are passed to the workflow item as a CUPS options string.
A file system URL pointing to the PDF file to be processed by the workflow item.
A result code. See “Core Printing Result Codes.”
The printing system uses this function in conjunction with the function PMWorkflowCopyItems to implement the PDF workflow button in the Print dialog.
In Mac OS X v10.4 and earlier, this function is not implemented and returns an error. You can use the function PMWorkflowSubmitPDFWithOptions together with the function PMPrintSettingsToOptions instead.
PMCore.hDefines a pointer to an idle function. (Deprecated. There is no replacement; this callback function was included to facilitate porting legacy applications to Mac OS X, but it serves no useful purpose.)
typedef void (*PMIdleProcPtr) (void);
You would declare your idle function like this if you were to name it MyPrintIdleCallback:
void MyPrintIdleCallback (void);
If you install an idle function using the function PMSessionSetIdleProc, the printing system calls your idle function periodically during your print loop. Your idle function can display application status while printing, but it should not duplicate information displayed by the printing system or the printer driver. If you don’t install an idle function, you get the standard dialog for the current driver in Mac OS 8 and 9.
Your idle function must check whether the user has pressed Command-period, in which case your application should stop its printing operation. If your status dialog contains a button to cancel the printing operation, your idle function should also check for clicks in the button and respond accordingly.
To provide a pointer to your idle function, you create a universal procedure pointer (UPP) of type PMIdleUPP, using the function NewPMIdleUPP. You can do so with code similar to the following:
PMIdleUPP MyPrintIdleUPP; |
MyPrintIdleUPP = NewPMIdleUPP (&MyPrintIdleCallback); |
When your print job is completed, you should use the function DisposePMIdleUPP to dispose of the universal procedure pointer associated with your idle function. However, if you will use the same idle function in subsequent print jobs, you can reuse the same UPP, rather than dispose of it and later create a new UPP.
Your idle function is not called in Mac OS X. It’s only called in Mac OS 8 and 9.
PMCoreDeprecated.hAn opaque type that represents a custom printing dialog.
typedef struct OpaquePMDialog* PMDialog;
This data type is used by functions that are not recommended or deprecated.
PMDefinitionsDeprecated.h
A type that defines a universal procedure pointer to an idle callback.
typedef PMIdleProcPtr PMIdleUPP;
This data type is used by functions that are not recommended or deprecated.
PMCoreDeprecated.h
A data structure that contains level, version, and release information for the imaging language used by a printer driver.
struct PMLanguageInfo {
Str32 level;
Str32 version;
Str32 release;
};
levelSpecifies the level of the imaging language used by the printer driver.
versionSpecifies the version of the imaging language.
releaseSpecifies the release of the imaging language.
The base type for all the opaque types used in Core Printing.
typedef const void* PMObject;
PMObject is the base type for opaque types such as PMPrintSession, PMPageFormat, PMPrintSettings, PMPrinter, PMPaper, PMPreset, and PMServer. PMObject is used in functions such as PMRetain and PMRelease that operate on any opaque type.
PMDefinitions.h
An opaque type that stores the settings in the Page Setup dialog.
typedef struct OpaquePMPageFormat* PMPageFormat;
Your application uses page format objects to store information such as the paper size, orientation, and scale of pages in a printing session. To create a page format object, you use the function PMCreatePageFormat. A new page format object is empty and unusable until you call PMSessionDefaultPageFormat or PMCopyPageFormat to initialize the settings. You can also use the functions PMSetPageFormatExtendedData and PMGetPageFormatExtendedData to store and retrieve application-specific data in a page format object.
PMDefinitions.hAn opaque type that stores information about the paper used in a print job.
typedef struct OpaquePMPaper* PMPaper;
Your application uses paper objects to identify standard and custom types of printing paper.
PMDefinitions.hA data structure that specifies the unprintable area of a paper object.
typedef PMRect PMPaperMargins;
Your application specifies paper margins when calling the function PMPaperCreateCustom to create a custom paper type. You can obtain a paper’s margins with the function PMPaperGetMargins.
PMDefinitions.hAn opaque type that stores information about a named preset available for a print job.
typedef struct OpaquePMPreset* PMPreset;
Your application uses a preset object to identify a named preset in the Print dialog. You typically obtain an instance of this type using the function PMPrinterCopyPresets.
PMDefinitions.h
An opaque type that represents a printer.
typedef struct OpaquePMPrinter* PMPrinter;
You typically obtain a printer object using the function PMSessionGetCurrentPrinter or PMServerCreatePrinterList.
PMDefinitions.h
An opaque type that stores information about a print job.
typedef struct OpaquePMPrintSession* PMPrintSession;
A printing session object contains information that’s needed by the page format and print settings objects, such as default page format and print settings values. For this reason, some printing functions can be called only after you have created a printing session object. For example, setting defaults for or validating page format and print settings objects can only be done after you have created a printing session object. Your application creates a printing session object using the function PMCreateSession.
You can use a printing session to implement multithreaded printing, and you can create multiple sessions within a single-threaded application. If your application does not use sheets, then your application can open only one dialog at a time. Each printing session can have its own dialog, and settings changed in one dialog are independent of settings in any other dialog.
PMDefinitions.h
An opaque type that stores the settings in the Print dialog.
typedef struct OpaquePMPrintSettings* PMPrintSettings;
Your application uses print settings objects to store information such as the number of copies and the range of pages to print in a printing session. To create a print settings object, you use the function PMCreatePrintSettings. A new print settings object is empty and unusable until you call PMSessionDefaultPrintSettings or PMCopyPrintSettings to initialize the settings. You can also use the functions PMSetPrintSettingsExtendedData and PMGetPrintSettingsExtendedData to store and retrieve application-specific data in a print settings object.
PMDefinitions.h
A data structure that describes a rectangle using four double-precision coordinates.
struct PMRect {
double top;
double left;
double bottom;
double right;
};
topThe vertical coordinate for the upper-left point of the rectangle.
leftThe horizontal coordinate for the upper-left point of the rectangle.
bottomThe vertical coordinate for the lower-right point of the rectangle.
rightThe horizontal coordinate for the lower-right point of the rectangle.
A data structure that contains printing resolution information.
struct PMResolution {
double hRes;
double vRes;
};
hResThe horizontal resolution in dots per inch (dpi).
vResThe vertical resolution in dots per inch (dpi).
The functions PMGetResolution and PMPrinterGetPrinterResolution use this structure to return printing resolution information. Your application can pass this information to the function PMSetResolution.
An opaque type that identifies a local or remote print server.
typedef struct OpaquePMServer* PMServer;
PMDefinitions.h
An opaque type that describes the graphics environment for printing a document.
typedef struct OpaquePMPrintContext* PMPrintContext;
This data type is used by functions that are not recommended or deprecated.
PMDefinitionsDeprecated.h
A type that specifies color modes to use for printing.
typedef UInt16 PMColorMode;
This data type is used by functions that are not recommended or deprecated.
PMDefinitionsDeprecated.hConstants your application can use to indicate it does not need certain types of data returned by various printing functions.
#define kPMNoData NULL #define kPMDontWantSize NULL #define kPMDontWantData NULL #define kPMDontWantBoolean NULL #define kPMNoPrintSettings NULL #define kPMNoPageFormat NULL #define kPMNoReference NULL
kPMNoDataSpecifies that your application does not need data returned for a particular parameter. For future compatibility, you are encouraged to use one of the following constants in cases where a specific type of data is not required.
kPMDontWantSizeSpecifies that your application does not need the size information returned by the printing function.
kPMDontWantDataSpecifies that your application does not need the data returned by the printing function.
kPMDontWantBooleanSpecifies that your application does not need a Boolean value returned by the printing function.
kPMNoPrintSettingsSpecifies that your application does not need a PMPrintSettings object returned by the printing function.
kPMNoPageFormatSpecifies that your application does not need a PMPageFormat object returned by the printing function.
kPMNoReferenceSpecifies that your application does not need a reference returned by the printing function.
Constants that specify the format of the data representation created with the functions PMPageFormatCreateDataRepresentation and PMPrintSettingsCreateDataRepresentation.
enum PMDataFormat { kPMDataFormatXMLDefault = 0, kPMDataFormatXMLMinimal = 1, kPMDataFormatXMLCompressed = 2 }; typedef enum PMDataFormat PMDataFormat;
kPMDataFormatXMLDefaultSpecifies a data format that is compatible with all Mac OS X versions. Data in this format can be used with the PMUnflattenXXX functions present in versions of Mac OS X prior to 10.5. This format is a pure XML representation of the data. However, this format is much larger than the more modern data formats described below.
Available in Mac OS X v10.5 and later.
Declared in PMDefinitions.h.
kPMDataFormatXMLMinimalSpecifies an uncompressed data format that is approximately 3-5 times smaller than kPMDataFormatXMLDefault. This data format is only compatible with Mac OS X v10.5 and later. This format is a good choice when you do not need to use the data in versions of Mac OS X prior to 10.5 and you need a pure XML representation of the data.
Available in Mac OS X v10.5 and later.
Declared in PMDefinitions.h.
kPMDataFormatXMLCompressedSpecifies a compressed data format that is approximately 20 times smaller than kPMDataFormatXMLDefault. This data format is only compatible with Mac OS X v10.5 and later. This format is a good choice when you do not need to use the data in versions of Mac OS X prior to 10.5 and the minimum data size is important. Note that this format is not a pure XML representation of the data.
Available in Mac OS X v10.5 and later.
Declared in PMDefinitions.h.
Constants that specify a destination for a print job.
typedef UInt16 PMDestinationType;
enum {
kPMDestinationInvalid = 0,
kPMDestinationPrinter = 1,
kPMDestinationFile = 2,
kPMDestinationFax = 3,
kPMDestinationPreview = 4,
kPMDestinationProcessPDF = 5
};
kPMDestinationInvalidSpecifies the destination is invalid.
Available in Mac OS X v10.1 and later.
Declared in PMDefinitions.h.
kPMDestinationPrinterSpecifies output to a printer.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMDestinationFileSpecifies output to a file.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMDestinationFaxSpecifies output to a fax. This destination is currently not supported.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMDestinationPreviewSpecifies output to print preview.
Available in Mac OS X v10.1 and later.
Declared in PMDefinitions.h.
kPMDestinationProcessPDFSpecifies output to a PDF workflow option.
Available in Mac OS X v10.4 and later.
Declared in PMDefinitions.h.
Constants that specify the document format for a print job.
#define kPMDocumentFormatDefault CFSTR("com.apple.documentformat.default") #define kPMDocumentFormatPDF CFSTR("application/pdf") #define kPMDocumentFormatPICT CFSTR("application/vnd.apple.printing-pict") #define kPMDocumentFormatPICTPS CFSTR("application/vnd.apple.printing-pict-ps") #define kPMDocumentFormatPostScript CFSTR("application/postscript")
kPMDocumentFormatDefaultSpecifies the default format for the printing system. In Mac OS X, the default format is PDF.
kPMDocumentFormatPDFSpecifies PDF.
kPMDocumentFormatPICTSpecifies PICT format.
kPMDocumentFormatPICTPSSpecifies PICT format with embedded PostScript.
kPMDocumentFormatPostScriptSpecifies PostScript format.
Constants that specify duplex mode settings.
typedef UInt32 PMDuplexMode;
enum {
kPMDuplexNone = 0x0001,
kPMDuplexNoTumble = 0x0002,
kPMDuplexTumble = 0x0003,
kPMSimplexTumble = 0x0004
};
kPMDuplexNonePrint on only one side of the paper.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMDuplexNoTumblePrint on both sides of the paper, with both sides oriented in the same direction (no tumbling.)
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMDuplexTumblePrint on both sides of the paper, with the output on the second side flipped relative to the first side (tumbling on.)
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMSimplexTumblePrint on only one side of the paper, but tumble the images while printing. This mode is not supported at this time.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
Constants that specify the graphics context for a print job.
#define kPMGraphicsContextDefault CFSTR("com.apple.graphicscontext.default") #define kPMGraphicsContextQuickdraw CFSTR("com.apple.graphicscontext.quickdraw") #define kPMGraphicsContextCoreGraphics CFSTR("com.apple.graphicscontext.coregraphics")
kPMGraphicsContextDefaultSpecifies the default graphics context for the application’s runtime environment.
kPMGraphicsContextQuickdrawSpecifies a QuickDraw graphics context.
kPMGraphicsContextCoreGraphicsSpecifies a Quartz graphics context. The default coordinate system for a Quartz printing context is not the same as that used for a QuickDraw printing context. A Quartz printing context defines the coordinates of the lower-left corner of the paper as (0,0) whereas the origin for a QuickDraw is at the upper-right corner of the paper’s imageable area.
Constants that specify page orientation.
typedef UInt16 PMOrientation;
enum {
kPMPortrait = 1,
kPMLandscape = 2,
kPMReversePortrait = 3,
kPMReverseLandscape = 4
};
kPMPortraitSpecifies portrait (vertical) page orientation. Portrait orientation performs no alteration of the logical page.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMLandscapeSpecifies landscape (horizontal) orientation. Landscape orientation performs a 90° counterclockwise rotation on the logical page image and sets the Quartz origin to the upper-left corner of the unrotated logical page with positive y-values increasing across and to the right of the unrotated page. This has the effect of rotating the logical page image 90° clockwise. In other words, the image appears on the unrotated page as if it were rotated 90° clockwise.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMReversePortraitSpecifies reverse portrait orientation. Reverse portrait orientation performs a 180° rotation on the logical page rectangle and sets the Quartz origin to the upper-right corner of the unrotated logical page with positive y-values increasing downwards. This has the effect of rotating the logical page image 180°. Reverse portrait orientation is supported in Mac OS X v10.5 and later.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMReverseLandscapeSpecifies reverse landscape page orientation. Landscape orientation performs a 90° clockwise rotation on the logical page rectangle and sets the Quartz origin to the lower-right corner of the unrotated logical page, with the positive y-values increasing to across and to the left of the unrotated page. This has the effect of rotating the logical page image 90° counterclockwise. In other words, the image appears on the unrotated page as if it were rotated 90° counterclockwise.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
Constants that specify the keys in a PDF workflow dictionary.
#define kPDFWorkFlowItemURLKey CFSTR("itemURL")
#define kPDFWorkflowDisplayNameKey CFSTR("displayName")
#define kPDFWorkflowFolderURLKey CFSTR("folderURL")
#define kPDFWorkflowItemsKey CFSTR("items")
kPDFWorkFlowItemURLKeyThe URL to the PDF workflow item.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
kPDFWorkflowDisplayNameKeyThe user-displayable name for the PDF workflow item.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
kPDFWorkflowFolderURLKeyThe URL to the folder containing PDF workflow items.
Available in Mac OS X v10.5 and later.
Declared in PMDefinitions.h.
kPDFWorkflowItemsKeyA Core Foundation array describing the PDF workflow items in the folder.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
Constants that specify keys for PostScript injection dictionary entries.
#define kPSInjectionSectionKey CFSTR("section") #define kPSInjectionSubSectionKey CFSTR("subsection") #define kPSInjectionPageKey CFSTR("page") #define kPSInjectionPlacementKey CFSTR("place") #define kPSInjectionPostScriptKey CFSTR("psdata")
kPSInjectionSectionKeySpecifies a section.
kPSInjectionSubSectionKeySpecifies a subsection.
kPSInjectionPageKeySpecifies a page.
kPSInjectionPlacementKeySpecifies placement.
kPSInjectionPostScriptKeySpecifies PostScript data.
Constants that specify PostScript injection options.
enum {
kPSPageInjectAllPages = -1,
kPSInjectionMaxDictSize = 5
};
kPSPageInjectAllPagesSpecifies to inject all pages in the print job with PostScript code.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPSInjectionMaxDictSizeSpecifies the maximum size needed for a dictionary used for PostScript injection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
Constants that specify where in the print job to inject PostScript code.
typedef UInt16 PSInjectionPlacement;
enum {
kPSInjectionBeforeSubsection = 1,
kPSInjectionAfterSubsection = 2,
kPSInjectionReplaceSubsection = 3
};
kPSInjectionBeforeSubsectionSpecifies that your PostScript code be inserted before the standard PostScript code that is normally emitted for the subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPSInjectionAfterSubsectionSpecifies that your PostScript code be inserted after the standard PostScript code that is normally emitted for the subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPSInjectionReplaceSubsectionSpecifies that your PostScript code replace the standard PostScript code that is normally emitted for the subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
Constants that specify keys for PostScript injection section values.
typedef SInt32 PSInjectionSection;
enum {
kInjectionSectJob = 1,
kInjectionSectCoverPage = 2
};
kInjectionSectJobSpecifies the job section. This is the default section if you do not specify a section key explicitly.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSectCoverPageSpecifies the cover page section. Currently unsupported.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
Constants that specify PostScript injection values for the subsection key.
typedef SInt32 PSInjectionSubsection;
enum {
kInjectionSubPSAdobe = 1,
kInjectionSubPSAdobeEPS = 2,
kInjectionSubBoundingBox = 3,
kInjectionSubEndComments = 4,
kInjectionSubOrientation = 5,
kInjectionSubPages = 6,
kInjectionSubPageOrder = 7,
kInjectionSubBeginProlog = 8,
kInjectionSubEndProlog = 9,
kInjectionSubBeginSetup = 10,
kInjectionSubEndSetup = 11,
kInjectionSubBeginDefaults = 12,
kInjectionSubEndDefaults = 13,
kInjectionSubDocFonts = 14,
kInjectionSubDocNeededFonts = 15,
kInjectionSubDocSuppliedFonts = 16,
kInjectionSubDocNeededRes = 17,
kInjectionSubDocSuppliedRes = 18,
kInjectionSubDocCustomColors = 19,
kInjectionSubDocProcessColors = 20,
kInjectionSubPlateColor = 21,
kInjectionSubPageTrailer = 22,
kInjectionSubTrailer = 23,
kInjectionSubEOF = 24,
kInjectionSubBeginFont = 25,
kInjectionSubEndFont = 26,
kInjectionSubBeginResource = 27,
kInjectionSubEndResource = 28,
kInjectionSubPage = 29,
kInjectionSubBeginPageSetup = 30,
kInjectionSubEndPageSetup = 31
};
kInjectionSubPSAdobeSpecifies the “%!PS-Adobe” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubPSAdobeEPSSpecifies the “%!PS-Adobe-3.0 EPSF-3.0” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubBoundingBoxSpecifies the “%BoundingBox” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubEndCommentsSpecifies the “%EndComments” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubOrientationSpecifies the “%Orientation” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubPagesSpecifies the “%Pages” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubPageOrderSpecifies the “%PageOrder” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubBeginPrologSpecifies the “%BeginProlog” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubEndPrologSpecifies the “%EndProlog” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubBeginSetupSpecifies the “%BeginSetup” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubEndSetupSpecifies the “%EndSetup” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubBeginDefaultsSpecifies the “%BeginDefaults” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubEndDefaultsSpecifies the “%EndDefaults” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubDocFontsSpecifies the “%DocumentFonts” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubDocNeededFontsSpecifies the “%DocumentNeededFonts” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubDocSuppliedFontsSpecifies the “%DocumentSuppliedFonts” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubDocNeededResSpecifies the “%DocumentNeededResources” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubDocSuppliedResSpecifies the “%DocumentSuppliedResources” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubDocCustomColorsSpecifies the “%DocumentCustomColors” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubDocProcessColorsSpecifies the “%DocumentProcessColors” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubPlateColorSpecifies the “%PlateColor” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubPageTrailerSpecifies the “%PageTrailer” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubTrailerSpecifies the “%Trailer” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubEOFSpecifies the “%EOF” (end of file) subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubBeginFontSpecifies the “%BeginFont” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubEndFontSpecifies the “%EndFont” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubBeginResourceSpecifies the “%BeginResource” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubEndResourceSpecifies the “%EndResource” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubPageSpecifies the “%Page” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubBeginPageSetupSpecifies the “%BeginPageSetup” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kInjectionSubEndPageSetupSpecifies the “%EndPageSetup” subsection.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
Constants that specify the domains for PostScript printer description (PPD) files.
typedef UInt16 PMPPDDomain;
enum {
kAllPPDDomains = 1,
kSystemPPDDomain = 2,
kLocalPPDDomain = 3,
kNetworkPPDDomain = 4,
kUserPPDDomain = 5,
kCUPSPPDDomain = 6
};
kAllPPDDomainsSpecifies all available domains.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
kSystemPPDDomainSpecifies the system domain.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
kLocalPPDDomainSpecifies the local domain.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
kNetworkPPDDomainSpecifies the network domain.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
kUserPPDDomainSpecifies the user domain.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
kCUPSPPDDomainSpecifies the CUPS domain.
Available in Mac OS X v10.3 and later.
Declared in PMDefinitions.h.
A constant that specifies that all pages of a document should be printed.
enum {
kPMPrintAllPages = -1
};
kPMPrintAllPagesSpecifies that all pages of a document should be printed.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
Constants that specify standard options for print quality.
typedef UInt32 PMQualityMode;
enum {
kPMQualityLowest = 0,
kPMQualityInkSaver = 1,
kPMQualityDraft = 4,
kPMQualityNormal = 8,
kPMQualityPhoto = 11,
kPMQualityBest = 13,
kPMQualityHighest = 15
};
kPMQualityLowestSpecifies to use the lowest print quality available to the printer.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMQualityInkSaverSpecifies to use a mode that saves ink, even if it slows printing.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMQualityDraftSpecifies to print at the highest speed, with the amount of ink used as a secondary consideration.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMQualityNormalSpecifies a general usage mode that balances quality and speed.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMQualityPhotoSpecifies to optimize the quality of photos on the page, with speed not a concern.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMQualityBestSpecifies to get the best print quality for all objects and photos on a page.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
kPMQualityHighestSpecifies to use the highest print quality available to the printer.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
Constants that specify the current state of a print queue.
typedef UInt16 PMPrinterState;
enum {
kPMPrinterIdle = 3,
kPMPrinterProcessing = 4,
kPMPrinterStopped = 5
};
kPMPrinterIdleSpecifies the idle state.
Available in Mac OS X v10.2 and later.
Declared in PMDefinitions.h.
kPMPrinterProcessingSpecifies the processing state.
Available in Mac OS X v10.2 and later.
Declared in PMDefinitions.h.
kPMPrinterStoppedSpecifies the stopped state.
Available in Mac OS X v10.2 and later.
Declared in PMDefinitions.h.
Constants that specify printer description types.
#define kPMPPDDescriptionType CFSTR("PMPPDDescriptionType")
kPMPPDDescriptionTypeSpecifies a PostScript printer description (PPD).
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
Constants that specify values, such as minimum and maximum values, that your application can pass to or obtain from printing functions.
typedef UInt32 PMTag;
enum {
kPMCurrentValue = 'curr',
kPMDefaultValue = 'dflt',
kPMMinimumValue = 'minv',
kPMMaximumValue = 'maxv',
kPMSourceProfile = 'srcp',
kPMMinRange = 'mnrg',
kPMMaxRange = 'mxrg',
kPMMinSquareResolution = 'mins',
kPMMaxSquareResolution = 'maxs',
kPMDefaultResolution = 'dftr'
};
kPMCurrentValueSpecifies the current setting or value.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMDefaultValueSpecifies the default setting or value.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMMinimumValueSpecifies the minimum setting or value.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMMaximumValueSpecifies the maximum setting or value.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMSourceProfileSpecifies a ColorSync source profile.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMMinRangeSpecifies the minimum resolution supported by the printer.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMMaxRangeSpecifies the maximum resolution supported by the printer.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMMinSquareResolutionSpecifies the minimum resolution setting for which the horizontal and vertical resolutions are equal.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMMaxSquareResolutionSpecifies the maximum resolution setting for which the horizontal and vertical resolutions are equal.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMDefaultResolutionSpecifies the default resolution setting for the printer (typically 72 dots per inch).
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
A constant that specifies an error value that indicates the user canceled a printing operation.
enum {
kPMCancel = 128
};
kPMCancelSpecifies that the user clicked the Cancel button in a Print or Page Setup dialog.
Available in Mac OS X v10.0 and later.
Declared in PMDefinitions.h.
This constant is provided for compatibility with old applications and printer drivers that expect the iPrAbort error code to be returned when the user cancels a printing operation.
The default idle function checks for Command-period keyboard events during printing, and sets the error condition equal to kPMCancel if one occurs. Your application can check for this condition using the PMSessionError function, and should cancel the print job if kPMCancel is returned.
If you supply your own idle function (not needed in Mac OS 8, 9, or X), your function must check for Command-period keyboard events, and set the error condition using the function PMSessionSetError.
Constants that specify a color mode to use for printing.
typedef UInt16 PMColorMode;
enum {
kPMBlackAndWhite = 1,
kPMGray = 2,
kPMColor = 3,
kPMColorModeDuotone = 4,
kPMColorModeSpecialColor = 5
};
kPMBlackAndWhiteSpecifies black-and-white mode.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMGraySpecifies grayscale mode.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMColorSpecifies color mode.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMColorModeDuotoneSpecifies two-channel color mode.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
kPMColorModeSpecialColorSpecifies to allow special colors such as metallic and light cyan.
Available in Mac OS X v10.0 and later.
Not available to 64-bit applications.
Declared in PMDefinitionsDeprecated.h.
These constants are used by functions that are deprecated.
This table lists the result codes defined for Core Printing.
© 2001, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-07-24)