An object that describes a printer’s capabilities.


class NSPrinter : NSObject


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.


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) -> NSSize

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.


enum NSPrinter.TableStatus

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


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.