Excuse me, Could I config printer setting in js?
-
Hi all, I base on
Meteor + Quasar
.
I tried to createRestaurant System
.
Now I would like toConfig Printer Setting
on JS.
How to do?My problem is:
- I have 2 printer connect My PC: One on reception and one in the cook
- I create 2 button
Print to Reception
,Print to Cook
- I would like to silence mode printing with specific printer name
Thanks for your helping
-
AFAIK, printing is only within the realm of the browser and not the realm of JavaScript. So, you can’t control where a print goes directly. You might want to rethink your workflow. For instance, if you have control over the server, which it seems you do, you could just “send” the order to the kitchen/ cook. Let the cook decide which order to print out. So, you’ll need something like a kitchen queue. In it, you’d have the list of orders still open and some indication that the order was already printed out by the kitchen staff.
Hope that makes sense.
Scott
-
Although this is an ancient thread (and I only saw it due to the spam post above) you can achieve silent printing if you control the machine the printer is hooked up to via qz tray: https://qz.io/api/
They have paid options, but it’s absolutely not needed. You do have to generate a self signed ssl cert, but you can then make JS print directly without any print prompt. I use it to print shipping labels to a thermal printer mostly.
Hopefully this helps someone who might find this thread via search.
Edit: Just for some more info, qz tray just sets up a websocket server that you can connect to via some simple JS, and send documents like HTML, or a URL to a pdf, img, etc. It takes about a day to get familiar with how to sign messages to send to the websocket server, but once you do it’s pretty nifty.