Instance Method

application:printFiles:withSettings:showPrintPanels:

Prints a group of files.

Declaration

- (NSApplicationPrintReply)application:(NSApplication *)application printFiles:(NSArray<NSString *> *)fileNames withSettings:(NSDictionary<NSPrintInfoAttributeKey, id> *)printSettings showPrintPanels:(BOOL)showPrintPanels;

Parameters

application

The application object that is handling the printing.

fileNames

An array of NSString objects, each of which contains the name of a file to print.

printSettings

A dictionary containing NSPrintInfo-compatible print job attributes.

showPrintPanels

A Boolean that specifies whether the print panel should be displayed for each file printed. Print progress indicators will be presented even if this value is NO.

Return Value

A constant indicating whether printing was successful. For a list of possible values, see NSApplicationPrintReply.

Discussion

Return NSPrintingReplyLater if the result of printing cannot be returned immediately, for example, if printing will cause the presentation of a sheet. If your method returns NSPrintingReplyLater it must always invoke the NSApplication method replyToOpenOrPrint:] when the entire print operation has been completed, successfully or not.

This delegate method replaces application:printFiles:, which is now deprecated. If your application delegate only implements the deprecated method, it is still invoked, and NSApplication uses private functionality to arrange for the print settings to take effect.

See Also

Printing

- application:printFile:

Sent when the user starts up the application on the command line with the -NSPrint option.

NSApplicationPrintReply

Constants that are returned by the delegate method application:printFiles:withSettings:showPrintPanels:.