Platforms to show: All Mac Windows Linux Cross-Platform

Back to CUPSMBS module.

CUPSMBS.CancelJob(name as string, job as Int32)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Cancel a print job on the default server.

name: Name of printer or class
job: Job ID, kJobIDCurrent for the current job, or kJobIDAll for all jobs

Pass kJobIDAll to cancel all jobs or kJobIDCurrent to cancel the current job on the named destination.

Raises exception on error.

CUPSMBS.GetDefault as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Get the default printer or class for the default server.
Example
MsgBox CUPSMBS.GetDefault

CUPSMBS.GetDestinations as CUPSDestinationMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Get the list of destinations from the default server.
Example
dim lines(-1) as string
for each c as CUPSDestinationMBS in CUPSMBS.GetDestinations
lines.append c.Name
next

MsgBox Join(lines,EndOfLine)

Starting with CUPS 1.2, the returned list of destinations include the printer-info, printer-is-accepting-jobs, printer-is-shared, printer-make-and-model, printer-state, printer-state-change-time, printer-state-reasons, and printer-type attributes as options. CUPS 1.4 adds the marker-change-time, marker-colors, marker-high-levels, marker-levels, marker-low-levels, marker-message, marker-names, marker-types, and printer-commands attributes as well.

Some examples using this method:

CUPSMBS.GetJobs(name as string, OnlyMyJobs as boolean, whichjobs as Integer) as CUPSJobMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Get the jobs from the default server.

name: "" = all destinations, otherwise show jobs for named destination
OnlyMyJobs: false = all users, true = mine
whichjobs: kWhichJobsAll, kWhichJobsActive, or kWhichJobsComplete

A "whichjobs" value of kWhichJobsAll returns all jobs regardless of state, while kWhichJobsActive returns jobs that are pending, processing, or held and kWhichJobsComplete returns jobs that are stopped, canceled, aborted, or completed.

Some examples using this method:

CUPSMBS.GetPassword(prompt as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Get a password from the user.

Returns "" if the user does not provide a password.

CUPSMBS.GetPPD(name as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Get the PPD file for a printer on the default server.
Example
for each c as CUPSDestinationMBS in CUPSMBS.GetDestinations
if c.isDefault then
MsgBox cupsmbs.GetPPD(c.Name)
end if
next

Returns Filename for PPD file.

For classes, cupsGetPPD returns the PPD file for the first printer in the class.

The returned filename is stored in a static buffer and is overwritten with each call to cupsGetPPD or cupsGetPPD2. The caller "owns" the file that is created and must unlink the returned filename.

CUPSMBS.LastError as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Return the last IPP status code.

CUPSMBS.LastErrorString as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Return the last IPP status-message.
Example
MsgBox CUPSMBS.LastErrorString

Returns status-message text from last request.

CUPSMBS.PrintData(name as string, Data as String, Title as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 16.5 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Print a file to a printer or class on the default server.

Name: Destination name
Data: Data to print
Title: Title of job

Returns Job ID or 0 on error

CUPSMBS.PrintFile(name as string, file as folderitem, title as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Print a file to a printer or class on the default server.
Example
// Print file on default printer...
dim f as FolderItem = SpecialFolder.Desktop.Child("test.ps")

for each c as CUPSDestinationMBS in CUPSMBS.GetDestinations
if c.isDefault then

call CUPSMBS.PrintFile(c.Name, f, f.Name)

end if
next

name: Destination name
filename: File to print
title: Title of job

Returns Job ID or 0 on error

See also:

Some examples using this method:

CUPSMBS.PrintFile(name as string, file as folderitem, title as string, options() as CUPSOptionMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Print a file to a printer or class on the default server.

name: Destination name
filename: File to print
title: Title of job
options: Options

Returns Job ID or 0 on error

See also:

CUPSMBS.PrintFiles(name as string, files() as folderitem, title as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Print files to a printer or class on the default server.

name: Destination name
filename: Files to print
title: Title of job

Returns Job ID or 0 on error

See also:

CUPSMBS.PrintFiles(name as string, files() as folderitem, title as string, options() as CUPSOptionMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Print files to a printer or class on the default server.

name: Destination name
files: Files to print
title: Title of job
options: Options

Returns Job ID or 0 on error

See also:

CUPSMBS.Server as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Return the hostname/address of the default server.
Example
MsgBox CUPSMBS.Server

The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6 address, or a domain socket pathname.

CUPSMBS.SetDefaultPrinter(printer as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 12.5 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Sets the default printer.

Name must be one of CUPSDestinationMBS's name.

CUPSMBS.SetServer(server as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Set the default server name.

server:Server name

The "server" string can be a fully-qualified hostname, a numeric IPv4 or IPv6 address, or a domain socket pathname. Pass "" to restore the default server name.

CUPSMBS.SetUser(user as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Set the default user name.

user: User name

Pass "" to restore the default user name.

CUPSMBS.User as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CUPS MBS Tools Plugin 9.7 ✅ Yes ❌ No ✅ Yes ❌ No Desktop, Console & Web
Return the current user's name.
Example
MsgBox CUPSMBS.User

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


The biggest plugin in space...