---
title: "PMSessionGetDataFromSession(_:_:_:)"
framework: applicationservices
role: symbol
role_heading: Function
path: applicationservices/1462964-pmsessiongetdatafromsession
---

# PMSessionGetDataFromSession(_:_:_:)

Obtains application-specific data previously stored in a printing session object.

## Declaration

```swift
func PMSessionGetDataFromSession(_ printSession: PMPrintSession, _ key: CFString, _ data: UnsafeMutablePointer<Unmanaged<CFTypeRef>?>) -> OSStatus
```

## Parameters

- `printSession`: The printing session whose data you want to obtain.
- `key`: The key that uniquely identifies the data to be retrieved. You specify this key when you store the data using the function doc://com.apple.documentation/documentation/applicationservices/1461902-pmsessionsetdatainsession.
- `data`: A pointer to your doc://com.apple.corefoundation/documentation/CoreFoundation/CFTypeRef variable. On return, the variable refers to the data retrieved from the printing session.

## 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(_:).

## See Also

### Accessing Data in Printing Session Objects

- [PMSessionSetDataInSession(_:_:_:)](applicationservices/1461902-pmsessionsetdatainsession.md)
- [PMSessionGetCurrentPrinter(_:_:)](applicationservices/1458998-pmsessiongetcurrentprinter.md)
- [PMSessionSetCurrentPMPrinter(_:_:)](applicationservices/1461096-pmsessionsetcurrentpmprinter.md)
- [PMSessionGetCGGraphicsContext(_:_:)](applicationservices/1461952-pmsessiongetcggraphicscontext.md)
- [PMSessionError(_:)](applicationservices/1460003-pmsessionerror.md)
- [PMSessionSetError(_:_:)](applicationservices/1460216-pmsessionseterror.md)
