Namespace: printers

qz.printers

Calls related to getting printer information from the connection.
Source:

Methods

(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) 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) → {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 Description
printers null | string | Array.<string> Printer or list of printers to listen to, null listens to all.
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)>