How can I print directly (without a dialog box) on a website with angularJS to a Zebra bluetooth printer! MZ320

0

The issue is that I am creating a website and I need to print a ticket (as they are in the bank to wait) and for this I need it to be direct from the print button of my web app to print to the printer. I've searched everywhere and I can not find anything. I am programming in AngularJS, and I need it to work on mobile devices. Greetings Thank you

    
asked by Emanuel 06.12.2018 в 18:00
source

1 answer

0

I think you can not without taking a dialog box for a security issue, (imagine that every time you entered a web page you printed the printer, lol). Anyway look at this that I found on the site in English, print it in string format:

This programmer has used this project link and this package of js link .

link

  

I did an application like that .. I did it using link and   the module in the comment: link , here   is a working code with this module printing raw in the default printer   a file:

var printer = require('printer');
var fs = require('fs');

var info = fs.readFileSync('ticket.txt').toString();

function sendPrint() {
  printer.printDirect({
    data: info,
    type: 'RAW',
    success: function (jobID) {
      console.log("ID: " + jobID);
    },
    error: function (err) {
      console.log('printer module error: '+err);
      throw err;
    }
  });
}

sendPrint();
    
answered by 08.12.2018 в 21:47