You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're trying to integrate qz-tray.js@version 2.1.0 [... with the ...] Tray 2.0 executable for receipt printing. All the characters are getting printed, but control commands such as Bold, Double font, etc... are not working.
We're using the code like this, ex: for Bold ON
functionchr(i){returnString.fromCharCode(i);}varcmd_on=chr(27)+chr(33)+chr(8);varcmd_off=chr(27)+chr(33)+chr(0);varprintData=[{type: 'raw',format:'plain',data: cmd_on},{type: 'raw',format:'plain',data: "Text to print"},{type: 'raw',format:'plain',data: cmd_off)}];
Also possibly related to the user's problem and worth noting:
That sample code uses format:'plain' which only exists as such in 2.0's data format. Using that with the 2.1 javascript has undefined results (since 2.1 js expects 2.1 data format, regardless of what version executable its talking to).
This change will make it appear to work correctly, but that is only because of the lossy conversion process required to support 2.0's data format coupled with the default format for the 'raw' type.
Quoting an email from a beta user:
2.1 has modified the API a bit... namely, 2.1 uses "type", "format" and "flavor" parameters as explained here: https://qz.io/wiki/2.1-Raw-Printing#escpos.
The text was updated successfully, but these errors were encountered: