---
title: "PMSessionGetCurrentPrinter(_:_:)"
framework: applicationservices
role: symbol
role_heading: Function
path: applicationservices/1458998-pmsessiongetcurrentprinter
---

# PMSessionGetCurrentPrinter(_:_:)

Obtains the current printer associated with a printing session.

## Declaration

```swift
func PMSessionGetCurrentPrinter(_ printSession: PMPrintSession, _ currentPrinter: UnsafeMutablePointer<PMPrinter?>) -> OSStatus
```

## Parameters

- `printSession`: The printing session whose printer you want to obtain.
- `currentPrinter`: A pointer to your doc://com.apple.documentation/documentation/applicationservices/pmprinter variable. On return, the variable refers to the printer associated with the specified printing session. The printer object is valid as long as the printing session is valid or the current printer hasn’t changed. You should not release this object without first retaining it.

## 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

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