Class

NSPrinter

An object that describes a printer’s capabilities.

Overview

NSPrinter provides information about a printer; it does not modify printer attributes or control a printing job. A printer object can be constructed by specifying either the printer name or the make and model of an available printer. Typically, Cocoa apps don't create NSPrinter objects; instead, the printing system uses these objects to support the printing jobs and when it shows users a list of printers.

Topics

Creating an NSPrinter

init?(name: String)

Creates and returns an NSPrinter object initialized with the specified printer name.

init?(type: NSPrinter.TypeName)

Creates and returns an NSPrinter object initialized to the first available printer with the specified make and model information.

Getting General Printer Information

class var printerNames: [String]

Returns the names of all available printers.

class var printerTypes: [NSPrinter.TypeName]

Returns descriptions of the makes and models of all available printers.

Getting Attributes

var name: String

Returns the printer’s name.

var type: NSPrinter.TypeName

Returns a description of the printer’s make and model.

Getting Specific Information

func pageSize(forPaper: NSPrinter.PaperName)

Returns the size of the page for the specified paper type.

var languageLevel: Int

Returns the PostScript language level recognized by the printer.

Querying the Tables

var deviceDescription: [NSDeviceDescriptionKey : Any]

Returns a dictionary of keys and values describing the device.

Constants

enum NSPrinter.TableStatus

These constants describe the state of a printer information table stored by an NSPrinter object.

Relationships

Inherits From

See Also

Print Job Information

class NSPrintInfo

An object that stores information that’s used to generate printed output.

class NSPrintOperation

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

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