• Download
  • Demo
  • Buy
  • API
  • Docs
  • Support
  • About
  • Contact
  • Login
API Home
Namespaces
qzapiconfigsfilehidnetworkingprinterssecurityserialsocketusbwebsocket
API Home
Namespaces
qzapiconfigsfilehidnetworkingprinterssecurityserialsocketusbwebsocket

Namespace: printers

qz.printers

Calls related to getting printer information from the connection.
Source:
  • qz-tray.js, line 1236

Methods

(static) details() → {Promise.<(Array.<Object>|Object|Error)>}

Provides a list, with additional information, for each printer available to QZ.
Source:
  • qz-tray.js, line 1274
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:
  • qz-tray.js, line 1263
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:
  • qz-tray.js, line 1249
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:
  • qz-tray.js, line 1332
See:
  • qz.printers.startListening
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:
  • qz-tray.js, line 1348

(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
Name Type Attributes Default Description
jobData null | boolean <optional>
false Flag indicating if raw spool file content should be return as well as status information (Windows only)
maxJobData null | number <optional>
-1 Maximum number of bytes to returns for raw spooled file content (Windows only)
flavor null | string <optional>
"plain" Flavor of data format returned. Valid flavors are [base64 | hex | plain*] (Windows only)
Since:
  • 2.1.0
Source:
  • qz-tray.js, line 1295
See:
  • qz.printers.setPrinterCallbacks
Returns:
Type
Promise.<(null|Error)>

(static) stopListening() → {Promise.<(null|Error)>}

Stop listening for printer status actions.
Since:
  • 2.1.0
Source:
  • qz-tray.js, line 1318
See:
  • qz.printers.setPrinterCallbacks
Returns:
Type
Promise.<(null|Error)>
Documentation generated by JSDoc 3.6.11

© 2023 qz | Privacy Policy