---
title: "PMPageFormatCreateWithDataRepresentation(_:_:)"
framework: applicationservices
role: symbol
role_heading: Function
path: applicationservices/1462876-pmpageformatcreatewithdatarepres
---

# PMPageFormatCreateWithDataRepresentation(_:_:)

Creates a page format object from a data representation.

## Declaration

```swift
func PMPageFormatCreateWithDataRepresentation(_ data: CFData, _ pageFormat: UnsafeMutablePointer<PMPageFormat?>) -> OSStatus
```

## Parameters

- `data`: The data representation of a page format object. The data representation must have been previously created with the function doc://com.apple.documentation/documentation/applicationservices/1464227-pmpageformatcreatedatarepresenta.
- `pageFormat`: A pointer to your doc://com.apple.documentation/documentation/applicationservices/pmpageformat variable. On return, the variable refers to a new page format object that contains the information stored in the specified data object. You are responsible for releasing the page format object with the function doc://com.apple.documentation/documentation/applicationservices/1461402-pmrelease.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion This function is typically used to convert a data representation stored in a user document back into a page format object. For information about creating a Core Foundation data object from raw data, see CFData. After 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)
- [PMPageFormatCreateDataRepresentation(_:_:_:)](applicationservices/1464227-pmpageformatcreatedatarepresenta.md)
