Platforms to show: All Mac Windows Linux Cross-Platform

Back to CPMPrinterMBS class.

CPMPrinterMBS.Constructor(name as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Initializes a new printer object given the printer name.

Raises exception if lookup fails.
This accepts both CUPS names and the Mac GUI names in printing control panel.

CPMPrinterMBS.DescriptionURL as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 12.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the description URL for this printer.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox printer.DescriptionURL

Should be the path to a PPD file for a laser printer.
Lasterror is set.

CPMPrinterMBS.DeviceURI as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 12.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Hand back the URI of the printer's device.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox printer.DeviceURI

On success returns a CFURLMBS object describing the printer's device.
Lasterror is set.

CPMPrinterMBS.DriverCreator as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a 4 letter code for the creator of the printer.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox "DriverCreator: "+str(printer.DriverCreator)

Lasterror is set.

CPMPrinterMBS.DriverReleaseInfo as CPMVersionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 15.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Queries printer driver version.

CPMPrinterMBS.HostName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Hand back the host name of the print server hosting the printer's print queue.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox "HostName: "+str(printer.HostName)

Lasterror is set.

CPMPrinterMBS.ID as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the ID of the string.

CPMPrinterMBS.IndexedPrinterResolution(index as Integer) as CPMResolutionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a printer resolution.

Lasterror is set.
Index is from 1 to ResolutionCount.

Some examples using this method:

CPMPrinterMBS.IsDefault as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether this printer is the default printer.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox "IsDefault: "+str(printer.IsDefault)

CPMPrinterMBS.IsFavorite as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Return true if the printer is in the user's favorite printer list.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox "IsFavorite: "+str(printer.IsFavorite)

CPMPrinterMBS.IsPostScriptCapable as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Can this printer do postscript?
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox "IsPostScriptCapable: "+str(printer.IsPostScriptCapable)

Lasterror is set.

CPMPrinterMBS.IsPostScriptPrinter as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
If the result is true if the printer is a PostScript printer.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox "IsPostScriptPrinter: "+str(printer.IsPostScriptPrinter)

A PostScript printer is one whose driver takes PostScript directly.

CPMPrinterMBS.IsRemote as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Hand back a boolean indicating whether the printer is hosted by remote print server.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox "IsRemote: "+str(printer.IsRemote)

If result is true, the print queue represents a printer hosted and managed by a remote print server.

If result is false, the print queue represents a directly connected printer, a network printer, or a remote printer that is locally managed. Consult the queue's device URI to determine the type of connection that is used to communicate with the printer.

Whether a printer is remote is derived from the CUPS printer-type attribute for the print queue.

CPMPrinterMBS.LanguageInfo as CPMLanguageInfoMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns language information about the printer.

Lasterror is set.

CPMPrinterMBS.Location as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the location of the printer.

CPMPrinterMBS.MakeAndModelName as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A string with the name for the model and the maker.

Lasterror is set.
Returns "" on any error.

CPMPrinterMBS.Name as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the name of the string.
Example
dim session as CPMPrintSessionMBS = NewCPMPrintSessionMBS
dim printer as CPMPrinterMBS = session.CurrentPrinter

MsgBox printer.name

CPMPrinterMBS.ResolutionCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns how much resolutions are supported by the printer.

Lasterror is set.

CPMPrinterMBS.SetDefault

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Set the default printer for the current user.

It is not typical for an application to set the current default printer for the user; the printing system itself takes care of managing the default printer.
This function should be used only in rare circumstances.

Requires Mac OS X 10.5.

CPMPrinterMBS.State as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Printing MBS MacCG Plugin 15.1 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Queries printer state.
Example
dim p as CPMPrinterMBS = CPMPrinterMBS.CreateFromPrinterID("Brother_DCP_8085DN")
MsgBox str(p.State)

Can be kPMPrinterIdle, kPMPrinterProcessing or kPMPrinterStopped.

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


The biggest plugin in space...