---
title: "PMPageFormatCreateDataRepresentation(_:_:_:)"
framework: applicationservices
role: symbol
role_heading: Function
path: applicationservices/1464227-pmpageformatcreatedatarepresenta
---

# PMPageFormatCreateDataRepresentation(_:_:_:)

Creates a data representation of a page format object.

## Declaration

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

## Parameters

- `pageFormat`: The page format object to convert.
- `data`: A pointer to your doc://com.apple.corefoundation/documentation/CoreFoundation/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 doc://com.apple.documentation/documentation/applicationservices/pmdataformat for a full description of these formats.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

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

- [PMCreatePageFormat(_:)](applicationservices/1459485-pmcreatepageformat.md)
- [PMCreatePageFormatWithPMPaper(_:_:)](applicationservices/1459274-pmcreatepageformatwithpmpaper.md)
- [PMCopyPageFormat(_:_:)](applicationservices/1464669-pmcopypageformat.md)
- [PMSessionDefaultPageFormat(_:_:)](applicationservices/1462217-pmsessiondefaultpageformat.md)
- [PMSessionValidatePageFormat(_:_:_:)](applicationservices/1459090-pmsessionvalidatepageformat.md)
- [PMSessionCreatePageFormatList(_:_:_:)](applicationservices/1463985-pmsessioncreatepageformatlist.md)
- [PMPageFormatCreateWithDataRepresentation(_:_:)](applicationservices/1462876-pmpageformatcreatewithdatarepres.md)
