Core Printing
Overview
Core Printing is a C API that Mac apps 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:
PMPrintSessionfor general information about a print jobPMPrintSettingsfor print job parametersPMPageFormatfor the page format of a printed documentPMPaperfor information about a type of paperPMPrinterfor 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.
Topics
Releasing and Retaining Printing Objects
Creating and Using Page Format Objects
PMCreatePageFormat(_:)PMCreatePageFormatWithPMPaper(_:_:)PMCopyPageFormat(_:_:)PMSessionDefaultPageFormat(_:_:)PMSessionValidatePageFormat(_:_:_:)PMSessionCreatePageFormatList(_:_:_:)PMPageFormatCreateDataRepresentation(_:_:_:)PMPageFormatCreateWithDataRepresentation(_:_:)
Accessing Data in Page Format Objects
PMGetPageFormatExtendedData(_:_:_:_:)PMSetPageFormatExtendedData(_:_:_:_:)PMGetPageFormatPaper(_:_:)PMPageFormatGetPrinterID(_:_:)PMGetOrientation(_:_:)PMSetOrientation(_:_:_:)PMGetScale(_:_:)PMSetScale(_:_:)PMGetAdjustedPageRect(_:_:)PMGetAdjustedPaperRect(_:_:)PMGetUnadjustedPageRect(_:_:)PMGetUnadjustedPaperRect(_:_:)
Creating and Using Print Settings Objects
PMCreatePrintSettings(_:)PMSessionDefaultPrintSettings(_:_:)PMSessionValidatePrintSettings(_:_:_:)PMPrintSettingsCreateDataRepresentation(_:_:_:)PMPrintSettingsCreateWithDataRepresentation(_:_:)PMCopyPrintSettings(_:_:)PMPrintSettingsToOptions(_:_:)PMPrintSettingsToOptionsWithPrinterAndPageFormat(_:_:_:_:)
Accessing Data in Print Settings Objects
PMGetFirstPage(_:_:)PMSetFirstPage(_:_:_:)PMGetLastPage(_:_:)PMSetLastPage(_:_:_:)PMGetPageRange(_:_:_:)PMSetPageRange(_:_:_:)PMPrintSettingsGetJobName(_:_:)PMPrintSettingsSetJobName(_:_:)PMGetCopies(_:_:)PMSetCopies(_:_:_:)PMGetCollate(_:_:)PMSetCollate(_:_:)PMGetDuplex(_:_:)PMSetDuplex(_:_:)PMPrintSettingsGetValue(_:_:_:)PMPrintSettingsSetValue(_:_:_:_:)PMPrintSettingsCopyAsDictionary(_:_:)PMPrintSettingsCopyKeys(_:_:)
Creating Printing Session Objects
Accessing Data in Printing Session Objects
PMSessionGetDataFromSession(_:_:_:)PMSessionSetDataInSession(_:_:_:)PMSessionGetCurrentPrinter(_:_:)PMSessionSetCurrentPMPrinter(_:_:)PMSessionGetCGGraphicsContext(_:_:)PMSessionError(_:)PMSessionSetError(_:_:)
Using Printer Presets
Creating and Using Paper Objects
Accessing Data in Paper Objects
PMPaperGetID(_:_:)PMPaperGetWidth(_:_:)PMPaperGetHeight(_:_:)PMPaperGetMargins(_:_:)PMPaperCreateLocalizedName(_:_:_:)PMPaperGetPrinterID(_:_:)PMPaperGetPPDPaperName(_:_:)
Print Loop Functions
PMSessionBeginCGDocumentNoDialog(_:_:_:)PMSessionEndDocumentNoDialog(_:)PMSessionBeginPageNoDialog(_:_:_:)PMSessionEndPageNoDialog(_:)
Accessing the Print Job Destination
PMSessionSetDestination(_:_:_:_:_:)PMSessionGetDestinationType(_:_:_:)PMSessionCopyDestinationFormat(_:_:_:)PMSessionCopyDestinationLocation(_:_:_:)PMSessionCopyOutputFormatList(_:_:_:)
Creating Printer Objects
PMServerLaunchPrinterBrowser(_:_:)PMServerCreatePrinterList(_:_:)PMSessionCreatePrinterList(_:_:_:_:)PMPrinterCreateFromPrinterID(_:)PMCreateGenericPrinter(_:)
Accessing Information About a Printer
PMPrinterCopyDescriptionURL(_:_:_:)PMPrinterCopyDeviceURI(_:_:)PMPrinterCopyHostName(_:_:)PMPrinterCopyPresets(_:_:)PMPrinterGetCommInfo(_:_:_:)PMPrinterGetDriverCreator(_:_:)PMPrinterGetID(_:)PMPrinterGetLocation(_:)PMPrinterGetMakeAndModelName(_:_:)PMPrinterGetMimeTypes(_:_:_:)PMPrinterGetName(_:)PMPrinterGetOutputResolution(_:_:_:)PMPrinterSetOutputResolution(_:_:_:)PMPrinterGetPaperList(_:_:)PMPrinterGetPrinterResolutionCount(_:_:)PMPrinterGetIndexedPrinterResolution(_:_:_:)PMPrinterGetState(_:_:)PMPrinterSetDefault(_:)PMPrinterIsDefault(_:)PMPrinterIsFavorite(_:)PMPrinterIsPostScriptCapable(_:)PMPrinterIsPostScriptPrinter(_:_:)PMPrinterIsRemote(_:_:)
Submitting a Print Job to a Printer
Accessing PostScript Printer Description Files
Printing with PostScript Data
Using PDF Workflow Items
PMWorkflowCopyItems(_:)PMWorkflowSubmitPDFWithOptions(_:_:_:_:)PMWorkflowSubmitPDFWithSettings(_:_:_:)
Data Types
Constants
PMDataFormatPMDestinationTypePMDuplexModePMOrientationPDF Workflow Dictionary KeysPMPPDDomainPrint All Pages ConstantPMQualityModePMPrinterStatePrinter Description TypesUser Cancellation Constant
Result Codes
kPMGeneralErrorkPMOutOfScopekPMNoDefaultPrinterkPMNotImplementedkPMNoSuchEntrykPMInvalidPrintSettingskPMInvalidPageFormatkPMValueOutOfRangekPMInvalidPrintSessionkPMInvalidPrinterkPMObjectInUsekPMInvalidIndexkPMStringConversionFailurekPMXMLParseErrorkPMInvalidJobTemplatekPMInvalidPrinterInfokPMInvalidConnectionkPMInvalidKeykPMInvalidValuekPMInvalidAllocatorkPMInvalidTicketkPMInvalidItemkPMInvalidTypekPMInvalidReplykPMInvalidFileTypekPMInvalidObjectkPMInvalidPaperkPMInvalidCalibrationTargetkPMInvalidPreset