EnumJobs
Description
Enumerates active jobs on the given printer.
Syntax
var jobName = {};
status = printing.EnumJobs(printerName, index, jobName);
Parameter | Description |
---|---|
printerName | (String) printer name on which to enumerate the jobs |
index |
(Number) Zero-based index of the job. Increment this value for each new EnumJobscall for a given printerName
An index of -1 will return the status of the printer, rather than a particular job. |
jobName | (Object) obtains a name for the job (available as jobName[0]) |
Returns a numeric value indicating the current status of the job. The bits have the following meaning:
Meaning | Value |
---|---|
JOB_STATUS_PAUSED | 0x00000001 |
JOB_STATUS_ERROR | 0x00000002 |
JOB_STATUS_DELETING | 0x00000004 |
JOB_STATUS_SPOOLING | 0x00000008 |
JOB_STATUS_PRINTING | 0x00000010 |
JOB_STATUS_OFFLINE | 0x00000020 |
JOB_STATUS_PAPEROUT | 0x00000040 |
JOB_STATUS_PRINTED | 0x00000080 |
JOB_STATUS_DELETED | 0x00000100 |
JOB_STATUS_BLOCKED_DEVQ | 0x00000200 |
JOB_STATUS_USER_INTERVENTION | 0x00000400 |
JOB_STATUS_RESTART | 0x00000800 |
Example
function window.onload() {
for (i = 0; printer = factory.printing.EnumPrinters(i); i++) {
alert("Printer name: " + printer);
var job = {};
for (j = 0; status = factory.printing.EnumJobs(printer, j, job); j++)
alert("Job name: " + job[0] + ", status: " + status);
}
}