Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSPrinterMBS class.

NSPrinterMBS.booleanForKey(key as string, table as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the Boolean value associated with the specified key.

key: The key whose value you want.
table: The name of a table from the printer's PPD file.

Returns the Boolean value associated with the key. Returns false if the key is not in the table or the receiver lacks a PPD file.

NSPrinterMBS.Constructor(name as string = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Initializes a printer object.

On success the handle property is not zero.
Name can be empty to pick default printer. Else pass name of printer.

NSPrinterMBS.copy as NSPrinterMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a clone of the printer object.

NSPrinterMBS.deviceDescription as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns a dictionary of keys and values describing the device.

A dictionary of the device properties. See NSGraphics.h for possible keys. The only key guaranteed to exist is NSDeviceIsPrinter.

NSPrinterMBS.floatForKey(key as string, table as string) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the floating-point value associated with the specified key.

key: The key whose value you want.
table: The name of a table from the printer's PPD file.

Returns the floating-point value. Returns 0.0 if the key is not in the table or the receiver lacks a PPD file.

NSPrinterMBS.intForKey(key as string, table as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the integer value associated with the specified key.

key: The key whose value you want.
table: The name of a table from the printer's PPD file.

Returns the integer value. Returns 0 if the key is not in the table or the receiver lacks a PPD file.

NSPrinterMBS.isKey(key as string, table as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns a Boolean value indicating whether the specified key is in the specified table.

key: The key whose value you want.
table: The name of a table from the printer's PPD file.
Returns true if the key is in the table; otherwise, false.

NSPrinterMBS.languageLevel as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the PostScript language level recognized by the printer.
Example
dim p as NSPrinterMBS = NSPrinterMBS.defaultPrinter
MsgBox "languageLevel: "+str(p.languageLevel)

Returns the PostScript language level. The value is 0 if the receiver is not a PostScript printer.

NSPrinterMBS.name as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the printer's name.
Example
dim p as NSPrinterMBS = NSPrinterMBS.defaultPrinter
MsgBox p.name

NSPrinterMBS.pageSizeForPaper(paperName as string) as NSSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the size of the page for the specified paper type.

paperName: Possible values are printer-dependent and are contained in the printer's PPD file. Typical values are "Letter" and "Legal".

Returns the size of the page, measured in points in the user coordinate space. The returned size is zero if the specified paper name is not recognized or its entry in the PPD file cannot be parsed.

NSPrinterMBS.rectForKey(key as string, table as string) as NSRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the rectangle associated with the specified key.

key: The key whose value you want.
table: The name of a table from the printer's PPD file.

Returns the rectangle value. Returns NSRectMBS.Zero if the key is not in the table or the receiver lacks a PPD file.

NSPrinterMBS.sizeForKey(key as string, table as string) as NSSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the size data type associated with the specified key.

key: The key whose value you want.
table: The name of a table from the printer's PPD file.

Returns the size value. Returns NSZeroSize if the key is not in the table or the receiver lacks a PPD file.

NSPrinterMBS.statusForTable(paperName as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the status of the specified table.

table: The name of a table from the printer's PPD file.

Returns one of the return values described in Constants.

NSPrinterMBS.stringForKey(key as string, table as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the first occurrence of a value associated with specified key.

key: The key whose value you want.
table: The name of a table from the printer's PPD file.

Returns the value for the specified key, or nil if the key is not in the table. The returned string may also be empty.

If key is a main keyword only, and if that keyword has options in the PPD file, this method returns an empty string. Use stringListForKey to retrieve the values for all occurrences of a main keyword.

NSPrinterMBS.stringListForKey(key as string, table as string) as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns an array of strings, one for each occurrence, associated with specified key.

key: The key whose value you want.
table: The name of a table from the printer's PPD file.

Returns an array of strings, each containing a value associated with the specified key. Returns nil if the key is not in the table.

NSPrinterMBS.type as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Printing MBS MacCocoa Plugin 12.4 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns a description of the printer's make and model.
Example
dim p as NSPrinterMBS = NSPrinterMBS.defaultPrinter
MsgBox p.type

The items on this page are in the following plugins: MBS MacCocoa Plugin.


The biggest plugin in space...