Hey. I have this laravel app, it has multiple printing sections. is it possible to choose a printer for each section so that the user doesn't have to manually do that? I was hoping maybe i add a ui that lists the sections and the locally installed printers so the user can select which one will print for what section and maybe set a default printer. That way, the app can check where to send the print command.
I think it's impossible. Neither Laravel nor Javascript has access to user's local printers. You can only show printing dialog with JS window.print(), then user sees preview, picks desired printer, pages, copies etc and starts actual printing.
You can open different sections in separate tabs (beware user's browser can prevent opening pop-ups and new tabs) and even launch printing dialog automatically on page load:
There are custom cases when Laravel server has direct access to network printers (connected to LAN). In that case you can send data directly to them which is tricky but doable.
@gp10devhts No. Printing is a client-side concern.
It would be a huge security issue if a PHP app hosted on some random server somewhere in the world could see what devices (including printers) were on your network.
It would be a huge security issue if a PHP app hosted on some random server somewhere in the world could see what devices (including printers) were on your network.