Instance Property

printSettings

A mutable dictionary containing the print settings from Core Printing.

Declaration

@property(readonly, strong) NSMutableDictionary<NSPrintInfoSettingKey, id> *printSettings;

Discussion

You can use this property to get and set values from the system print settings. The keys in the dictionary represent the values returned by the Core Printing function PMPrintSettingsGetValue. They correspond to the settings currently in the print panel and include everything from custom values set by your accessory panels to values provided by the printer driver’s print dialog extension.

Adding keys to the dictionary is equivalent to calling the Core Printing function PMPrintSettingsSetValue. Your new keys are added to the current print settings and are saved with any user preset files generated by the macOS printing system. Because the print settings are stored in a property list, any values you add to the dictionary must correspond to scalar types such as strings, numbers, dates, booleans, and data objects or collection types such as dictionaries and arrays.

Other parts of the printing system use key strings like com.apple.print.PrintSettings.PMColorSyncProfileID to identify print settings. Cocoa replaces the periods in such strings with underscores. Thus, the preceding key string would be com_apple_print_PrintSettings_PMColorSyncProfileID instead. If you use reverse-DNS style key strings for your custom attributes, you should follow the same convention of using underscore characters instead of periods.

See Also

Accessing Core Printing Information

- PMPrintSession

Returns a Core Printing object configured with the receiver’s session information.

- PMPageFormat

Returns a Core Printing object configured with the receiver’s page format information.

- PMPrintSettings

Returns a Core Printing object configured with the receiver’s print settings information

- updateFromPMPageFormat

Synchronizes the receiver’s page format information with information from its associated PMPageFormat object.

- updateFromPMPrintSettings

Synchronizes the receiver’s print settings information with information from its associated PMPrintSettings object.