I'd like to know if it is possible via PHP to setup a print button which will print to a specified printer which is not the default printer.
Basically, I have 2 print layouts, one A4 and the other one an 80mm (receipt). Right now every time I click on the print button, it will show a dialog box and I have to choose the printer, I was wondering if I can do something faster, which when I click on button "Print A4", it will print on the A4 printer and when I click on the button "Print Receipt", it will print on the receipt printer.
Is this possible?
No, it is not possible since PHP is server sided.
Furthermore, the OS Print options cannot be bypassed by a website. The Default printer is determined on the visitor's OS. This is among other things in place to safeguard the printer from malicious printing by websites.
Look here,
WebApp Hardware Bridge (succeeder of "Chrome Hardware Bridge / Chrome Direct Print")
Make it possible for WebApp to perform silent print and access to serial ports.
Common use cases:
Web-based POS - PDF and ESC/POS receipt silent print Web-based WMS - Serial weight scale real-time reading, delivery Note/packing List silent print WebApp that need to read/write to serial ports