---
title: "init(view:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsprintoperation/init(view:)"
---

# init(view:)

Creates and returns an print operation object ready to control the printing of the specified view.

## Declaration

```swift
init(view: NSView)
```

## Parameters

- `view`: The view whose contents you want to print.

## Return Value

Return Value The new NSPrintOperation object. You must run the operation to print the view.

## Discussion

Discussion The new NSPrintOperation object uses the settings stored in the shared NSPrintInfo object. This method raises an NSPrintOperationExistsException if there is already a print operation in progress; otherwise the returned object is made the current print operation for this thread.

## See Also

### Related Documentation

- [run()](appkit/nsprintoperation/run().md)

### Creating the Printing Operation Object

- [epsOperation(with:inside:to:)](appkit/nsprintoperation/epsoperation(with:inside:to:).md)
- [epsOperation(with:inside:to:printInfo:)](appkit/nsprintoperation/epsoperation(with:inside:to:printinfo:).md)
- [epsOperation(with:inside:toPath:printInfo:)](appkit/nsprintoperation/epsoperation(with:inside:topath:printinfo:).md)
- [pdfOperation(with:inside:to:)](appkit/nsprintoperation/pdfoperation(with:inside:to:).md)
- [pdfOperation(with:inside:to:printInfo:)](appkit/nsprintoperation/pdfoperation(with:inside:to:printinfo:).md)
- [pdfOperation(with:inside:toPath:printInfo:)](appkit/nsprintoperation/pdfoperation(with:inside:topath:printinfo:).md)
- [init(view:printInfo:)](appkit/nsprintoperation/init(view:printinfo:).md)
