2

am tyring to implmented EPSON Javascript receipt printing using POS Printer (SDK) from web browser but when I click the button it's printing the Browre header part only from printer not the actual text following code am using ..

function sendDocument() { //Create a print document var request = ''; request += ''; request += 'Hello, World! '; request += 'This is the test drive!!! '; request += '';

    request += '</epos-print>';
    //Create a SOAP envelop
    var soap = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body>' + request + '</s:Body></s:Envelope>';
    //Create an XMLHttpRequest object
    var xhr = new XMLHttpRequest();
    //Set the end point address
    var url = 'http://192.168.1.25:9100/cgi-bin/epos/service.cgi?devid=local_printer&timeout=10000';
    //Open an XMLHttpRequest object
    xhr.open('POST', url, true);
    //<Header settings>
    xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
    xhr.setRequestHeader('If-Modified-Since', 'Thu, 01 Jan 1970 00:00:00 GMT');
    // Send print document
    xhr.send(soap);

    setTimeout(function(){ alert("Printed?"); }, 2000);
    
}

0 Answers0