---
title: NSPrintOperation
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsprintoperation
---

# NSPrintOperation

An object that controls operations that generate Encapsulated PostScript (EPS) code, Portable Document Format (PDF) code, or print jobs.

## Declaration

```swift
@MainActor class NSPrintOperation
```

## Overview

Overview An NSPrintOperation object works in conjunction with two other objects: an NSPrintInfo object, which specifies how the code should be generated, and an NSView object, which generates the actual code. It is important to note that the majority of methods in NSPrintOperation copy the instance of NSPrintInfo passed into them. Future changes to that print info are not reflected in the print info retained by the current NSPrintOperation object. All changes should be made to the print info before passing to the methods of this class. The only method in NSPrintOperation which does not copy the NSPrintInfo instance is printInfo. note: You should not subclass NSPrintOperation. Methods that return a print operation object return an instance of a concrete subclass whose implementation is private.

## Topics

### 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:)](appkit/nsprintoperation/init(view:).md)
- [init(view:printInfo:)](appkit/nsprintoperation/init(view:printinfo:).md)

### Setting the Current Print Operation for This Thread

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

### Determining the Type of Operation

- [isCopyingOperation](appkit/nsprintoperation/iscopyingoperation.md)

### Modifying the Printing Information

- [printInfo](appkit/nsprintoperation/printinfo.md)
- [NSPrintInfo](appkit/nsprintinfo.md)

### Getting the View

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

### Getting the Printing Quality

- [preferredRenderingQuality](appkit/nsprintoperation/preferredrenderingquality.md)
- [NSPrintOperation.RenderingQuality](appkit/nsprintoperation/renderingquality.md)

### Running the Print Operation

- [run()](appkit/nsprintoperation/run().md)
- [runModal(for:delegate:didRun:contextInfo:)](appkit/nsprintoperation/runmodal(for:delegate:didrun:contextinfo:).md)
- [cleanUp()](appkit/nsprintoperation/cleanup().md)
- [deliverResult()](appkit/nsprintoperation/deliverresult().md)

### Modifying the User Interface

- [showsPrintPanel](appkit/nsprintoperation/showsprintpanel.md)
- [showsProgressPanel](appkit/nsprintoperation/showsprogresspanel.md)
- [jobTitle](appkit/nsprintoperation/jobtitle.md)
- [printPanel](appkit/nsprintoperation/printpanel.md)
- [pdfPanel](appkit/nsprintoperation/pdfpanel.md)

### Managing the Drawing Context

- [context](appkit/nsprintoperation/context.md)
- [createContext()](appkit/nsprintoperation/createcontext().md)
- [destroyContext()](appkit/nsprintoperation/destroycontext().md)

### Managing Page Information

- [currentPage](appkit/nsprintoperation/currentpage.md)
- [pageRange](appkit/nsprintoperation/pagerange.md)
- [pageOrder](appkit/nsprintoperation/pageorder-swift.property.md)
- [NSPrintOperation.PageOrder](appkit/nsprintoperation/pageorder-swift.enum.md)

### Managing Printing Threads

- [canSpawnSeparateThread](appkit/nsprintoperation/canspawnseparatethread.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)

## See Also

### Print Information

- [NSPrinter](appkit/nsprinter.md)
- [NSPrintInfo](appkit/nsprintinfo.md)
