O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required