PMGetPageFormatExtendedData(_:_:_:_:)
Obtains extended page format data previously stored by your application.
Declaration
func PMGetPageFormatExtendedData(_ pageFormat: PMPageFormat, _ dataID: OSType, _ size: UnsafeMutablePointer<UInt32>?, _ extendedData: UnsafeMutableRawPointer?) -> OSStatusParameters
- pageFormat:
The page format object that contains your extended data.
- dataID:
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.
- size:
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
kPMDontWantSizeif you do not need this information. (See Data_not_wanted_constants for more information.) - extendedData:
A pointer to a buffer to receive the extended data. Pass the constant
kPMDontWantDataif you do not want to read the data. (See Data_not_wanted_constants for more information.)
Return Value
A result code. See Result Codes.
Discussion
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.