Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Printer.GetJobsAsJSON

Queries print jobs and returns JSON Array.

Component Version macOS Windows Linux Server iOS SDK
Printer 16.3 ✅ Yes ✅ Yes ❌ No ❌ No ❌ No
MBS( "Printer.GetJobsAsJSON" { ; Name; OnlyMyJobs; whichJobs } )   More

Parameters

Parameter Description Example Flags
Name Name of the printer queue to query.
If no name or empty string is specified, we get all queues.

On Windows we default to the default printer if name is empty.
"Brother_DCP_8085DN" Optional
OnlyMyJobs Pass either "my" for your users jobs or "all" for all jobs. "all" Optional
whichJobs Pass "active" to get only active jobs, "all" for all jobs or "complete" for completed jobs. "complete" Optional

Result

Returns JSON array or error.

Description

Queries print jobs and returns JSON Array.
We implemented this for Windows and then added a similar implementation for macOS.
FieldValueNote
JobIdA job identifier.
PrinterNameThe name of the printer for which the job is spooled.
MachineNameThe name of the machine that created the print job.Windows only
UserNameThe name of the user that owns the print job.
DocumentThe name of the print job (for example, "MS-WORD: Review.doc").
DataTypeThe type of data used to record the print jobWindows only
FormateThe spooling type. MacOS only
StatusThe job status. The value of this member can be zero or a combination of one or more of the flag values. A value of zero indicates that the print queue was paused after the document finished spooling.different
PriorityThe job priority. This member can be one of the following values or in the range between 1 through 99.different
PositionThe job's position in the print queue.Windows only
TotalPagesThe total number of pages that the document contains. This value may be zero if the print job does not contain page delimiting information.Windows only
PagesPrintedThe number of pages that have printed. This value may be zero if the print job does not contain page delimiting information.Windows only
CreationTimeThe timestamp that this document was spooled.
ProcessingTimeThe timestamp that this document was processed.macOS only
CompletedTimeThe timestamp that this document was completed.macOS only

States on macOS are Pending, Held, Processing, Stopped, Cancelled, Aborted or Completed.
States on Windows are a combination of Paused, Error, Deleting, Spooling, Printing, Offline, Paperout, Printed, Deleted, Blocked device, User Intervention, Restart, Complete, Retained and Rendering locally.

Examples

Query printer jobs on macOS:

MBS( "Printer.GetJobsAsJSON" )

Example result:
[ { "JobId": 7412, "PrinterName": "Laserdrucker", "Format": "application/pdf", "Document": "Untitled", "UserName": "cs", "Status": 5, "State": "Processing", "Priority": 50, "Size": 7, "CompletedTime": "01.01.1970 01:00", "CreationTime": "18.05.2026 12:38:31", "ProcessingTime": "18.05.2026 12:38:31" } ]

Query printer jobs on Windows:

MBS( "Printer.GetJobsAsJSON"; "Laserdrucker")

Example result:
[ { "JobId": 2, "PrinterName": "Laserdrucker", "MachineName": "\\\\TESTSERVER", "Document": "Test", "UserName": "cs", "Status": 8209, "State": "Paused, Printing, Retained", "TotalPages": 0, "PagesPrinted": 1, "Priority": 1, "Position": 1, "CreationTime": "18.05.2026 13:19:35,022" } ]

Get all my jobs:

MBS( "Printer.GetJobsAsJSON"; ""; "my"; "all" )

See also

Release notes

  • Version 16.3
    • Added Printer.CancelJob and Printer.GetJobsAsJSON functions.

This function checks for a license.

Created 18th May 2026, last changed 18th May 2026


Printer.GetDefaultPrinter - Printer.PaperFormats