---
title: "PMSessionCopyDestinationLocation(_:_:_:)"
framework: applicationservices
role: symbol
role_heading: Function
path: applicationservices/1462967-pmsessioncopydestinationlocation
---

# PMSessionCopyDestinationLocation(_:_:_:)

Obtains a destination location for a print job.

## Declaration

```swift
func PMSessionCopyDestinationLocation(_ printSession: PMPrintSession, _ printSettings: PMPrintSettings, _ destLocationP: UnsafeMutablePointer<Unmanaged<CFURL>?>) -> OSStatus
```

## Parameters

- `printSession`: The printing session that provides a context for the print job.
- `printSettings`: The print settings for the print job whose destination location you want to obtain.
- `destLocationP`: A pointer to your doc://com.apple.corefoundation/documentation/CoreFoundation/CFURL variable. On return, the variable refers to a Core Foundation URL that specifies the destination location of the print job. You are responsible for releasing the URL. If NULL is returned and the function executes without error (result code is noErr), the print job uses the default destination location for the current destination type. If an error occurs, the variable is set to 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(_:). Some destination types define a specific kind of destination location for a print job. For example, the destination type kPMDestinationFile uses a file system URL to specify where a new file should be created for the print job’s output.

## See Also

### Accessing the Print Job Destination

- [PMSessionSetDestination(_:_:_:_:_:)](applicationservices/1459855-pmsessionsetdestination.md)
- [PMSessionGetDestinationType(_:_:_:)](applicationservices/1461071-pmsessiongetdestinationtype.md)
- [PMSessionCopyDestinationFormat(_:_:_:)](applicationservices/1464266-pmsessioncopydestinationformat.md)
- [PMSessionCopyOutputFormatList(_:_:_:)](applicationservices/1461332-pmsessioncopyoutputformatlist.md)
