QZTray JS Class Wrapper
An JS Class Wrapper for Qz-Tray (https://qz.io/), making it easier to implement the Qz-Tray on you system.
$ npm install qztrayjsclass
API
import QzTrayClass from 'qztrayjsclass'; // Startingconst QzTray = new QzTrayClass({ certificateUrl: '(Your QzTray Certificate URL)', // Or you can pass the certificate directly rawCertificate: '', signUrl: '(Your QzTray Sign URL)', printer: 'Zebra'}); QzTray.start(); // PDF PrintQzTray.pdfPrint({ pdfData: '', isBase64: false, pageOptions: {}, printerOptions: {},}); // HTML PrintQzTray.htmlPrint({ pageUrl: '', format: '', pageOptions: {}, printerOptions: {},}); // Image PrintQzTray.imagePrint({ imgData: '', isBase64: '', pageOptions: {}, printerOptions: {},}); // Raw PrintQzTray.rawPrint({ rawData: [], pageOptions: {}, printerOptions: {},}); //
Parameters
Constructor
Property | Type | Default |
---|---|---|
certificateUrl | string | '' |
rawCertificate | string | '' |
signUrl | string | '' |
printer | string | REQUIRED |
If you dont pass the certificateUrl or rawCertificate, the requests will be treated as anonymous
PDF Print
Property | Type | Default |
---|---|---|
pdfData | string | '' |
isBase64 | boolean | false |
pageOptions | object | https://qz.io/api/qz#.print |
printerOptions | object | (https://qz.io/api/qz.configs#.setDefaults) |
Image Print
Property | Type | Default |
---|---|---|
imgData | string | '' |
isBase64 | boolean | false |
pageOptions | object | https://qz.io/api/qz#.print |
printerOptions | object | (https://qz.io/api/qz.configs#.setDefaults) |
HTML Print
Property | Type | Default |
---|---|---|
pageUrl | string | '' |
format | string | '' |
pageOptions | object | https://qz.io/api/qz#.print |
printerOptions | object | (https://qz.io/api/qz.configs#.setDefaults) |
RAW Print
More info about raw printing (https://qz.io/wiki/2.0-raw-printing)
Property | Type | Default |
---|---|---|
rawData | array | [] |
pageOptions | object | https://qz.io/api/qz#.print |
printerOptions | object | (https://qz.io/api/qz.configs#.setDefaults) |