<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPrintOperation/init(view:printInfo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPrintOperation(cm)printOperationWithView:printInfo:"
  },
  "title" : "init(view:printInfo:)"
}
-->

# init(view:printInfo:)

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

```
init(view: NSView, printInfo: NSPrintInfo)
```

## Parameters

`view`

The view whose contents you want to print.

`printInfo`

The print settings to use when printing the view.

## Return Value

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

## Discussion

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

[`-  runOperation`](/documentation/AppKit/NSPrintOperation/run())

Runs the print operation on the current thread.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)