Epson TM-T20II-i ePOS-Print XML Users Manual - Page 48
Transmission of Print Document, To Call SOAP/HTTP Interface
View all Epson TM-T20II-i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 48 highlights
Transmission of Print Document A print document is sent using an ePOS-Print object. Create an ePOS-Print object using the constructor and specify the end point address for the printer to be used for printing as well as the print document into the send method to send the document. For the details about the printer end point address, refer to Printer End Point Address (p.50). Refer to the following program. ePOS-Print supported TM printer checks the status of the TM printer used for printing and then start printing operation. To Call SOAP/HTTP Interface Refer to the following program. TITLE function sendDocument() { //Create a print document var request = ''; request += ''; request += ''; request += 'Hello, World! '; request += ''; request += ''; //Create a SOAP envelop var soap = '' + '' + request + ''; //Create an XMLHttpRequest object var xhr = new XMLHttpRequest(); //Set the end point address var url = 'http://192.168.192.168/cgi-bin/epos/ service.cgi?devid=local_printer&timeout=10000'; //Open an XMLHttpRequest object xhr.open('POST', url, true); // xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8'); xhr.setRequestHeader('If-Modified-Since', 'Thu, 01 Jan 1970 00:00:00 GMT'); xhr.setRequestHeader('SOAPAction', '""'); // Send print document xhr.send(soap); } Send print document 48