PMPrintSettingsCreateDataRepresentation(_:_:_:)
Creates a data representation of a print settings object.
Declaration
func PMPrintSettingsCreateDataRepresentation(_ printSettings: PMPrintSettings, _ data: UnsafeMutablePointer<Unmanaged<CFData>?>, _ format: PMDataFormat) -> OSStatusParameters
- printSettings:
The print settings object to convert.
- data:
A pointer to your Cfdata 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.
- format:
A constant that specifies the format of the data representation. Supported values are:
kPMDataFormatXMLDefault(compatible with all macOS versions)kPMDataFormatXMLMinimal(approximately 3-5 times smaller; compatible with macOS 10.5 and later)kPMDataFormatXMLCompressed(approximately 20 times smaller; compatible with macOS 10.5 and later)
See Pmdataformat for a full description of these formats.
Return Value
A result code. See Result Codes.
Discussion
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.
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.