---
title: "PMSessionCreatePageFormatList(_:_:_:)"
framework: applicationservices
role: symbol
role_heading: Function
path: applicationservices/1463985-pmsessioncreatepageformatlist
---

# PMSessionCreatePageFormatList(_:_:_:)

Obtains a list of page format objects, each of which describes a paper size available on the specified printer.

## Declaration

```swift
func PMSessionCreatePageFormatList(_ printSession: PMPrintSession, _ printer: PMPrinter?, _ pageFormatList: UnsafeMutablePointer<Unmanaged<CFArray>?>) -> OSStatus
```

## Parameters

- `printSession`: The current printing session.
- `printer`: The printer whose list of page sizes you want to enumerate.
- `pageFormatList`: A pointer to your doc://com.apple.corefoundation/documentation/CoreFoundation/CFArray variable. On return, the variable refers to a Core Foundation array that contains the page format (PMPageFormat) objects associated with the specified printer. You are responsible for releasing the array. Each page format object describes a paper size available for the specified printer. If the function fails, then on return the array is NULL.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion You must call this function between the creation and release of a printing session. See the function PMCreateSession(_:). You can use this function to find the available sheet sizes (and the imageable area for them) for a given printer. After you obtain the page format list, you can call the function PMGetUnadjustedPaperRect(_:_:) for each page format object in the list to obtain the sheet rectangle size. Once you find the paper size you want, call PMGetUnadjustedPageRect(_:_:) to obtain the imageable area for that paper size.

## 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)
- [PMPageFormatCreateDataRepresentation(_:_:_:)](applicationservices/1464227-pmpageformatcreatedatarepresenta.md)
- [PMPageFormatCreateWithDataRepresentation(_:_:)](applicationservices/1462876-pmpageformatcreatewithdatarepres.md)
