chrome.printingMetrics
- Description
Use the
chrome.printingMetrics
API to fetch data about printing usage. - Permissions
printingMetrics
Summary
- Types
- Methods
chrome.printingMetrics.getPrintJobs(callback: function)
- Events
Types
MediaSize
Properties
- heightnumber
Height (in micrometers) of the media used for printing.
- vendorIdstring
Vendor-provided ID, e.g. "iso_a3_297x420mm" or "na_index-3x5_3x5in". Possible values are values of "media" IPP attribute and can be found on IANA page .
- widthnumber
Width (in micrometers) of the media used for printing.
PrintJobInfo
Properties
- completionTimenumber
The job completion time (in milliseconds past the Unix epoch).
- creationTimenumber
The job creation time (in milliseconds past the Unix epoch).
- idstring
The ID of the job.
- numberOfPagesnumber
The number of pages in the document.
- printer
The info about the printer which printed the document.
- printer_status
The status of the printer.
- settings
The settings of the print job.
- source
Source showing who initiated the print job.
- sourceIdstring optional
ID of source. Null if source is PRINT_PREVIEW or ANDROID_APP.
- status
The final status of the job.
- titlestring
The title of the document which was printed.
PrintSettings
Properties
- color
The requested color mode.
- copiesnumber
The requested number of copies.
- duplex
The requested duplex mode.
- mediaSize
The requested media size.
Printer
Properties
- namestring
Displayed name of the printer.
- source
The source of the printer.
- uristring
The full path for the printer. Contains protocol, hostname, port, and queue.
ColorMode
Enum
"BLACK_AND_WHITE"
, or "COLOR"
DuplexMode
Enum
"ONE_SIDED"
, "TWO_SIDED_LONG_EDGE"
, or "TWO_SIDED_SHORT_EDGE"
PrintJobSource
The source of the print job.
Enum
"PRINT_PREVIEW"
, "ANDROID_APP"
, or "EXTENSION"
PrintJobStatus
The final status of the print job.
Enum
"FAILED"
, "CANCELED"
, or "PRINTED"
PrinterSource
The source of the printer.
Enum
"USER"
, or "POLICY"
Methods
getPrintJobs
chrome.printingMetrics.getPrintJobs(callback: function)
Returns the list of the finished print jobs.
Parameters
- callbackfunction
The callback parameter should be a function that looks like this:
(jobs: PrintJobInfo[]) => {...}
- jobs
Events
onPrintJobFinished
chrome.printingMetrics.onPrintJobFinished.addListener(listener: function)
Event fired when the print job is finished. This includes any of termination statuses: FAILED, CANCELED and PRINTED.
Event
- listenerfunction
The listener parameter should be a function that looks like this:
(jobInfo: PrintJobInfo) => {...}
- jobInfo