Class

NSPrintPanel

The Print panel that queries the user for information about a print job.

Overview

A Print panel may let the user select the range of pages to print and the number of copies before executing the Print command. Print panels can display a simplified interface when printing certain types of data. For example, the panel can display a list of print-setting presets, which lets the user enable print settings in groups as opposed to individually. Assigning an appropriate string to the jobStyleHint property activates the simplified interface and identifies which presets to display.

Topics

Customizing the Panel

var jobStyleHint: NSPrintPanel.JobStyleHint?

The type of settings that the print panel displays.

var options: NSPrintPanel.Options

The current configuration options for the Print panel.

func defaultButtonTitle()

Returns the title of the Print panel’s default button.

func setDefaultButtonTitle(String?)

Sets the title of the Print panel’s default button.

var helpAnchor: NSHelpManager.AnchorName?

The HTML help anchor associated with the Print panel.

Managing Accessory Views

func addAccessoryController(NSViewController & NSPrintPanelAccessorizing)

Adds a custom controller to the Print panel to manage an accessory view.

func removeAccessoryController(NSViewController & NSPrintPanelAccessorizing)

Removes the specified controller and accessory view from the Print panel.

var accessoryControllers: [NSViewController]

The array of controller objects that manage the Print panel’s accessory views.

Running the Panel

func runModal()

Displays the receiver's Print panel and begins the modal loop.

func runModal(with: NSPrintInfo)

Displays the receiver’s Print panel and runs the modal loop using the specified printing information.

Communicating with the NSPrintInfo Object

var printInfo: NSPrintInfo

The printing information associated with the running Print panel.

Constants

Job Style Hints

Constants to be used as job style hints for activating the simplified Print panel interface and setting the options to display.

struct NSPrintPanel.Options

These constants are used to configure the contents of the main Print panel.

Relationships

Inherits From

Conforms To

See Also

Print Panels

class NSPageLayout

A panel that queries the user for information such as paper type and orientation.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software