我可以使用javascripts window.print将zpl打印到通过USB连接的斑马打印机吗?
问题描述:
查看此链接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连接的斑马打印机吗?
答
您必须使用KR403,因为203不支持ZPL。考虑使用Zebra的浏览器打印通过此应用程序从JavaScript路由到USB端口:
https://www.zebra.com/us/en/products/software/barcode-printers/link-os/browser-print.html
答
为什么不使用网络模式?
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);
}
我在想同样的事情,但没有看到列为与浏览器打印兼容的KR打印机。 –
我刚才也看到了。 –
KR403将与BrowserPrint一起使用 – banno