---
title: "PMSessionGetDestinationType(_:_:_:)"
framework: applicationservices
role: symbol
role_heading: Function
path: applicationservices/1461071-pmsessiongetdestinationtype
---

# PMSessionGetDestinationType(_:_:_:)

Obtains the output destination for a print job.

## Declaration

```swift
func PMSessionGetDestinationType(_ printSession: PMPrintSession, _ printSettings: PMPrintSettings, _ destTypeP: UnsafeMutablePointer<PMDestinationType>) -> OSStatus
```

## Parameters

- `printSession`: The printing session that provides a context for the print job. This must be the same printing session used for the Print dialog. The printing session contains the preview setting, which can override the destination type in the print settings.
- `printSettings`: The print settings for the print job whose destination you want to obtain.
- `destTypeP`: A pointer to your PMDestinationType variable. On return, the variable contains the destination type for the specified print job. Possible values include: kPMDestinationPrinter (output to a printer) kPMDestinationFile (output to a file) kPMDestinationFax (output to a fax) kPMDestinationPreview (output to print preview) kPMDestinationProcessPDF (output to a PDF workflow option) See doc://com.apple.documentation/documentation/applicationservices/pmdestinationtype for a complete description of the destination type constants.

## 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(_:). All of the destination types are stored in the print settings object except for kPMDestinationPreview, which is stored in the printing session object. If the destination type is set as preview, the preview setting overrides the destination set in the print settings object.

## See Also

### Accessing the Print Job Destination

- [PMSessionSetDestination(_:_:_:_:_:)](applicationservices/1459855-pmsessionsetdestination.md)
- [PMSessionCopyDestinationFormat(_:_:_:)](applicationservices/1464266-pmsessioncopydestinationformat.md)
- [PMSessionCopyDestinationLocation(_:_:_:)](applicationservices/1462967-pmsessioncopydestinationlocation.md)
- [PMSessionCopyOutputFormatList(_:_:_:)](applicationservices/1461332-pmsessioncopyoutputformatlist.md)
