Calls related to getting printer information from the connection.
- Source:
Methods
(static) clearQueue(optionsopt) → {Promise.<(null|Error)>}
Clear the queue of a specified printer or printers. Does not delete retained jobs.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
string | Object |
<optional> |
Name of printer to clear
Properties
|
- Since:
- 2.2.4
- Source:
Returns:
- Type
- Promise.<(null|Error)>
(static) details() → {Promise.<(Array.<Object>|Object|Error)>}
Provides a list, with additional information, for each printer available to QZ.
- Source:
Returns:
- Type
- Promise.<(Array.<Object>|Object|Error)>
(static) find(queryopt, signatureopt, signingTimestampopt) → {Promise.<(Array.<string>|string|Error)>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
query |
string |
<optional> |
Search for a specific printer. All printers are returned if not provided. |
signature |
string |
<optional> |
Pre-signed signature of hashed JSON string containing call='printers.find' , params , and timestamp . |
signingTimestamp |
number |
<optional> |
Required with signature . Timestamp used with pre-signed content. |
- Source:
Returns:
The matched printer name if
query
is provided.
Otherwise an array of printer names found on the connected system.
- Type
- Promise.<(Array.<string>|string|Error)>
(static) getDefault(signatureopt, signingTimestampopt) → {Promise.<(string|Error)>}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
signature |
string |
<optional> |
Pre-signed signature of hashed JSON string containing call='printers.getDefault , params , and timestamp . |
signingTimestamp |
number |
<optional> |
Required with signature . Timestamp used with pre-signed content. |
- Source:
Returns:
Name of the connected system's default printer.
- Type
- Promise.<(string|Error)>
(static) getStatus() → {Promise.<(null|Error)>}
Retrieve current printer status from any active listeners.
- Since:
- 2.1.0
- Source:
- See:
Returns:
- Type
- Promise.<(null|Error)>
(static) setPrinterCallbacks(calls)
List of functions called for any printer status change.
Event data will contain
{string} printerName
and {string} status
for all types.
For RECEIVE types, {Array} output
(in hexadecimal format).
For ERROR types, {string} exception
.
For ACTION types, {string} actionType
.
Parameters:
Name | Type | Description |
---|---|---|
calls |
function | Array.<function()> | Single or array of Function({Object} eventData) calls. |
- Since:
- 2.1.0
- Source:
(static) startListening(printers, optionsopt) → {Promise.<(null|Error)>}
Start listening for printer status events, such as paper_jam events.
Reported under the ACTION type in the streamEvent on callbacks.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
printers |
null | string | Array.<string> | Printer or list of printers to listen to, null listens to all. | |||||||||||||||||||||
options |
Object | null |
<optional> |
Printer listener options
Properties
|
- Since:
- 2.1.0
- Source:
- See:
Returns:
- Type
- Promise.<(null|Error)>
(static) stopListening() → {Promise.<(null|Error)>}
Stop listening for printer status actions.
- Since:
- 2.1.0
- Source:
- See:
Returns:
- Type
- Promise.<(null|Error)>