Instance Method

runModalPrintOperation:delegate:didRunSelector:contextInfo:

Runs the specified print operation modally.

Declaration

- (void)runModalPrintOperation:(NSPrintOperation *)printOperation delegate:(id)delegate didRunSelector:(SEL)didRunSelector contextInfo:(void *)contextInfo;

Parameters

printOperation

The print operation to run.

delegate

The delegate to which the selector message is sent.

didRunSelector

The selector of the message sent to the delegate.

contextInfo

Object passed with the callback to provide any additional context information.

Discussion

Overrides of printShowingPrintPanel: can invoke this method.

When the panel is dismissed, delegate is sent a didRunSelector message. Pass the contextInfo object with the callback. The didRunSelector callback method should have the following signature:

- (void)documentDidRunModalPrintOperation:(NSDocument *)document  success:(BOOL)success  contextInfo:(void *)contextInfo

See Also

Printing Documents

printInfo

The printing information associated with the document.

- preparePageLayout:

Invoked by runModalPageLayoutWithPrintInfo: and runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo: to do any customization of the Page Layout panel pageLayout, such as adding an accessory view.

- runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:

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

- shouldChangePrintInfo:

Returns a Boolean value indicating whether the receiver should allow changes to the default NSPrintInfo object used in printing the document.

- printOperationWithSettings:error:

Creates a print operation and returns it if successful.

PDFPrintOperation

A print operation that 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.