chrome.printerProvider
| Description: |
The chrome.printerProvider API exposes events used by print
manager to query printers controlled by extensions, to query their
capabilities and to submit print jobs to these printers.
|
| Availability: |
Since Chrome 44.
|
| Permissions: |
"printerProvider"
|
Summary
| Types | |
|---|---|
| PrinterInfo | |
| Events | |
| onGetPrintersRequested | |
| onGetUsbPrinterInfoRequested | |
| onGetCapabilityRequested | |
| onPrintRequested | |
Types
PrinterInfo
| properties | ||
|---|---|---|
| string | id |
Unique printer ID. |
| string | name |
Printer's human readable name. |
| string | (optional) description |
Printer's human readable description. |
Events
onGetPrintersRequested
Event fired when print manager requests printers provided by extensions.
addListener
chrome.printerProvider.onGetPrintersRequested.addListener(function callback)
| Parameters | ||||||||
|---|---|---|---|---|---|---|---|---|
| function | callback |
The callback parameter should be a function that looks like this: function(function resultCallback) {...};
|
||||||
onGetUsbPrinterInfoRequested
Since Chrome 45.
Event fired when print manager requests information about a USB device that may be a printer.
Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event.
addListener
chrome.printerProvider.onGetUsbPrinterInfoRequested.addListener(function callback)
| Parameters | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| function | callback |
The callback parameter should be a function that looks like this: function( usb.Device device, function resultCallback) {...};
|
|||||||||
onGetCapabilityRequested
Event fired when print manager requests printer capabilities.
addListener
chrome.printerProvider.onGetCapabilityRequested.addListener(function callback)
| Parameters | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| function | callback |
The callback parameter should be a function that looks like this: function(string printerId, function resultCallback) {...};
|
|||||||||
onPrintRequested
Event fired when print manager requests printing.
addListener
chrome.printerProvider.onPrintRequested.addListener(function callback)
| Parameters | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| function | callback |
The callback parameter should be a function that looks like this: function(object printJob, function resultCallback) {...};
|
||||||||||||||||||||||||