Epson TM-T70-i ePOS-Print API Users Manual For TM-i firmware 4.1 - Page 54
Reception of Print Result, var epos = new epson.CanvasPrintaddress, epos.onreceive = function res
View all Epson TM-T70-i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 54 highlights
Reception of Print Result The print result can be received by setting a callback function using the onreceive property (p. 145) of the ePOS-Print Canvas API object. The following information is obtained: ❏ Print result ❏ Error code ❏ Printer Status The printer status can be obtained when communication with the printer is possible. Refer to the following program. For the details about how to program a callback function in detail, refer to Error handling (p.48). TITLE function drawCanvas() { // Rendering in HTML5 Canvas // var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); . . . //Set the end point address var address = 'http://192.168.192.168/cgi-bin/epos/ service.cgi?devid=local_printer&timeout=10000'; //Create an ePOS-Print Canvas API object var epos = new epson.CanvasPrint(address); //Set a response receipt callback function epos.onreceive = function (res) { //When the printing is not successful, display a message if (!res.success) { alert('A print error occurred'); } } //Print epos.cut = true; epos.print(canvas); } Print result receipt callback function Run 54