Directly printing to network printer without dialog box

I am currently building a prototype that should allow to print a label on a network printer (Zebra) without any dialog box in between (no window.print). I found following JavaScript code but nothing is printed... I am using the Personal Environment. What am I doing wrong? (the x.x.x.x should of course be replaced with a proper IP address).


SyntaxEditor Code Snippet

var URL = 'http://x.x.x.x/pstprint';
var async = true;
var method = 'POST';
var ZPL = '^XA^FO20,10^AD^FDOutSystems Test^FS^FO20,60^B3^FD" + GetProductionOrder.List.Current.Material.Number + "^FS^XZ';
var request = new XMLHttpRequest();

request.onload = function()
{
    var status = request.status;
    var data = request.reponseText;
}

request.open(method, URL, async);
request.send(ZPL);

Hi Eric,

Unless your browser is in kiosk mode, you cannot do this for security reasons (you wouldn't want any web page to be able to send data to or otherwise access your printer).

Hi Kilian,

Would it be possible at all to connect to a network printer when running OutSystems (Personal Environment) in Chrome Kiosk Mode?

Afaik (but google for more info), if running in kiosk mode, there's no dialog popping up when using document.print().