Contents

PMPageFormatCreateDataRepresentation(_:_:_:)

Creates a data representation of a page format object.

Declaration

func PMPageFormatCreateDataRepresentation(_ pageFormat: PMPageFormat, _ data: UnsafeMutablePointer<Unmanaged<CFData>?>, _ format: PMDataFormat) -> OSStatus

Parameters

  • pageFormat:

    The page format 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 page format 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 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.

Before calling this function, you should call the function PMSessionValidatePageFormat(_:_:_:) to make sure the page format object contains valid values.

See Also

Creating and Using Page Format Objects