---
title: "PMSessionEndDocumentNoDialog(_:)"
framework: applicationservices
role: symbol
role_heading: Function
path: applicationservices/1464527-pmsessionenddocumentnodialog
---

# PMSessionEndDocumentNoDialog(_:)

Ends a print job started by calling the function PMSessionBeginCGDocumentNoDialog(_:_:_:) or PMSessionBeginDocumentNoDialog.

## Declaration

```swift
func PMSessionEndDocumentNoDialog(_ printSession: PMPrintSession) -> OSStatus
```

## Parameters

- `printSession`: The current printing session. On return, the printing session is no longer valid; however, you must still call the function doc://com.apple.documentation/documentation/applicationservices/1461402-pmrelease to release the object.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion This function is similar to the function PMSessionEndDocument except that the printing status dialog is suppressed. This function is used to end a print job, and it should be called within your application’s print loop after the call to the function PMSessionEndPageNoDialog and before releasing the printing session. The same printing session that is created by the function PMCreateSession for the Print dialog should be used for the print loop. The function PMSessionEndDocumentNoDialog must be called after its corresponding Begin function (PMSessionBeginCGDocumentNoDialog(_:_:_:) or PMSessionBeginDocumentNoDialog). If the Begin function returns noErr, the function PMSessionEndDocument must be called, even if errors occur within the scope of the Begin and End functions. You should not call PMSessionEndDocumentNoDialog if the Begin function returns an error.

## See Also

### Print Loop Functions

- [PMSessionBeginCGDocumentNoDialog(_:_:_:)](applicationservices/1460101-pmsessionbegincgdocumentnodialog.md)
- [PMSessionBeginPageNoDialog(_:_:_:)](applicationservices/1463416-pmsessionbeginpagenodialog.md)
- [PMSessionEndPageNoDialog(_:)](applicationservices/1462014-pmsessionendpagenodialog.md)
