Name

NSPrinter — Mac OS X 10.0

Synopsis

This class represents a printer as it is described in its PPD file. Using this class, applications can obtain information about any of the printers found in the Print Center application. To create an instance of NSPrint, use either the method printerWithName: or the method printerWithType:. If the printer indicated by the name or type does not exist in the Print Center printer list, these methods will return nil. In these methods, Type refers to the make and model of the printer, while Name refers to the name given to the printer in Print Center. Applications can obtain arrays of the names and types of available printers by invoking the class methods printerNames and printerTypes, respectively.

image with no caption

@interface NSPrinter : NSObject <NSCoding, NSCopying>
                                  // Convenience Constructors
   + (NSArray *)printerNames;
   + (NSArray *)printerTypes;
   + (NSPrinter *)printerWithName:(NSString *)name;
   + (NSPrinter *)printerWithName:(NSString *)name 
                                 domain:(NSString *)domain 
                                 includeUnavailable:(BOOL)flag;
   + (NSPrinter *)printerWithType:(NSString *)type;
                                  // Instance Methods
   - (BOOL)acceptsBinary;
   - (BOOL)booleanForKey:(NSString *)key 
                                 inTable:(NSString *)table;
   - (NSDictionary *)deviceDescription;
   - (NSString *)domain;
   - (float)floatForKey:(NSString *)key 
                                 inTable:(NSString *)table;
   - (NSString *)host;
   - (NSRect)imageRectForPaper:(NSString ...

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.