Epson TM-T70-i ePOS-Print API Users Manual For TM-i firmware 4.1 - Page 59
Programming Example, res.printjobid, epos.sendrequest
View all Epson TM-T70-i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 59 highlights
Chapter 3 Programming Guide Programming Example A response containing the specified print job ID will be returned when the spooler function is enabled. ePOS-Print Service I/F will issue a print job ID if the print job ID is not specified by the application. The print job status can be acquired using the print job ID contained in the response. var printjobid = ''; function sendJob() { var builder = new epson.ePOSBuilder(); builder.addText('Hello, World!\n'); builder.addCut(); var request = builder.toString(); var address = 'http://192.168.192.168/cgi-bin/epos/ service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onreceive = function (res) { if (res.success) { printjobid = res.printjobid; } } epos.onerror = function (err) { alert(err.status); }; epos.send(request); } function getJobStatus() { if (printjobid.length > 0) { var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi'; 3 var epos = new epson.ePOSPrint(address); epos.onreceive = function (res) { alert(res.success); }; epos.onerror = function (err) { alert(err.status); }; epos.getPrintJobStatus(printjobid); } } 59