Instance Method


Creates and returns a print operation for the document's contents.


- (NSPrintOperation *)printOperationWithSettings:(NSDictionary<NSPrintInfoAttributeKey, id> *)printSettings error:(NSError * _Nullable *)outError;



The print settings dictionary to use.


On return, if the print operation could not be created, a pointer to an error object that encapsulates the reason it could not be created.

Return Value

The print operation, or nil if unsuccessful.


The print operation can be run to print the document’s current contents. The NSPrintInfo attributes in the passed-in printSettings dictionary are added to a copy of the document’s print info, and the resulting print info is used for the operation.

See Also

Printing the Document


The printing information associated with the document.

- preparePageLayout:

Adds document-specific content to the Page Layout panel.

- runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:

Runs the modal page layout panel with the receiver’s printing information object.

- runModalPrintOperation:delegate:didRunSelector:contextInfo:

Runs the specified print operation modally.

- shouldChangePrintInfo:

Returns a Boolean value that indicates whether the document allows changes to the default printing information.

- printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:

Prints the document's contents, optionally displaying a print panel to the user.


A print operation you can use to create a PDF representation of the document’s current contents.

- saveDocumentToPDF:

Exports a PDF representation of the document’s current contents.