2017-08-08 158 views
2

查看此鏈接https://www.zebra.com/us/en/products/printers/kiosk.html在我看來,你可以完成這項任務。我只是想知道是否有其他人試過這個。再加上鍍鉻進入展臺模式(https://mycartpos.zendesk.com/hc/en-us/articles/200868343-Enable-kiosk-printing-print-automatically-for-Google-Chrome-on-Windows)似乎可以實現自助服務打印。如果我正在討論這個錯誤,並且應該堅持試圖弄清楚如何將原始zpl發送到打印機,請告訴我。我可以使用javascripts window.print將zpl打印到通過USB連接的斑馬打印機嗎?

回答

0

爲什麼不使用網絡模式?

function print() 
{ 
    var zpl = "YOUR ZPL TEXT" 
    var ip_addr = "YOUR IP" 
    var output = document.getElementById("output"); 
    var url = "http://"+ip_addr+"/pstprnt"; 
    var method = "POST"; 
    var async = true; 
    var request = new XMLHttpRequest(); 

    request.onload = function() { 
    var status = request.status; // HTTP response status, e.g., 200 for "200 OK" 
    var data = request.responseText; // Returned data, e.g., an HTML document. 
    output.innerHTML = "Status: " + status + "<br>" + data; 
    } 

    request.open(method, url, async); 
    request.setRequestHeader("Content-Length", zpl.length); 

    // Actually sends the request to the server. 
    request.send(zpl); 
}