Class

NSPrinter

An NSPrinter object describes a printer’s capabilities. It provides information about a printer; it does not modify printer attributes or control a printing job. An NSPrinter object can be constructed by specifying either the printer name or the make and model of an available printer.

Overview

It is not typical for Cocoa apps to create NSPrinter objects. The printing system uses these objects to support the printing jobs and when it shows users a list of printers.

Symbols

Creating an NSPrinter

init?(name: String)

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

init?(type: String)

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

Getting General Printer Information

class func printerNames()

Returns the names of all available printers.

class func printerTypes()

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

Getting Attributes

var name: String

Returns the printer’s name.

var type: String

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

Getting Specific Information

func pageSize(forPaper: String)

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: [String : Any]

Returns a dictionary of keys and values describing the device.

Constants

NSPrinterTableStatus

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

Relationships

Inherits From