admin管理员组

文章数量:1125786

I currently have an MS Access client app - to generate Purchase Orders - which can print PDF versions of a PO to a named printer on the Windows 10/11 client PC. The Access backend holds the name of the printer and is read by the front-end client mdb app and printed accordingly. The business requires it goes to a printer holding yellow paper - so that the end user doesn't have to get up to swap the paper each time (yes, we are having to hand-hold our staff). There is also a dedicated printer for PO's with recharges applied to them. Again, their Pink Copy PO printer names are assigned to each user account within the Access app. Currently, the user just clicks the printer icon for the PO and the app grabs the named printer from the backend and prints to the appropriate printer.

I want to move away from Access and was hoping to recreate it as a browser web app (with JavaScript client-side and PHP/SQL Server for the backend), as we already have this environment in place). Having spoken with the manager, it appears any additional clicks for the end user is an issue.

The initial stumbling block is with the printing, as I need to print POs to named printers on the client side. I believe JavaScript in the browser can only open the printer dialog, but does not allow selecting the relevant stored named printer for a user.

Can someone please suggest any possible solutions to accommodate the above scenario? I wondered if creating a browser extension might allow interacting with Windows printers, or creating and publishing nodejs with the app installed to each client to gain access to their locally installed printers?

I currently have an MS Access client app - to generate Purchase Orders - which can print PDF versions of a PO to a named printer on the Windows 10/11 client PC. The Access backend holds the name of the printer and is read by the front-end client mdb app and printed accordingly. The business requires it goes to a printer holding yellow paper - so that the end user doesn't have to get up to swap the paper each time (yes, we are having to hand-hold our staff). There is also a dedicated printer for PO's with recharges applied to them. Again, their Pink Copy PO printer names are assigned to each user account within the Access app. Currently, the user just clicks the printer icon for the PO and the app grabs the named printer from the backend and prints to the appropriate printer.

I want to move away from Access and was hoping to recreate it as a browser web app (with JavaScript client-side and PHP/SQL Server for the backend), as we already have this environment in place). Having spoken with the manager, it appears any additional clicks for the end user is an issue.

The initial stumbling block is with the printing, as I need to print POs to named printers on the client side. I believe JavaScript in the browser can only open the printer dialog, but does not allow selecting the relevant stored named printer for a user.

Can someone please suggest any possible solutions to accommodate the above scenario? I wondered if creating a browser extension might allow interacting with Windows printers, or creating and publishing nodejs with the app installed to each client to gain access to their locally installed printers?

Share Improve this question edited 2 days ago jonrsharpe 122k30 gold badges264 silver badges472 bronze badges asked 2 days ago Fred FanackerpanFred Fanackerpan 272 bronze badges 5
  • I think you need to use an app server (like node.js) for the backend, and use HTML and javascript for the front end. Essentially, the backend detects the printers etc and sends everything to front end. The user choses all settings in the browser, sends it all back to the app server and the app server starts the printing – ControlAltDel Commented 2 days ago
  • Thanks John. How would the backend initiate the printing to a named printer, which differs per user, without having to install all available printers server-side; as there are multiple yellow/pink-copy printers situated around the building. Also, a user who doesn't normally create PO's, just needs to print a copy PO to their own default printer. Apologies for the name change Jon. – Fred Fanackerpan Commented 2 days ago
  • It seems to be possible. See this QA: stackoverflow.com/questions/44682756/… – ControlAltDel Commented 2 days ago
  • ... possible... in a business/office environment – ControlAltDel Commented 2 days ago
  • the use of browser printing brings its challenges as the one way Microsoft EXPECTS it to be simplistically automated is using Edge with KIOSK printing to the attached local printer. Think Coffee Shop / Library printing. you can call Edge as an --app= with either a HTA OR HTML OR PDF and let the user click merrily like in Internet Explorer days but you need to provide the customisation for whistles and bells. Thus a challenge to best be avoided if you have a working application already. There are other options such as Chrome(MSEdge)-Headless but that will not be GUI – K J Commented yesterday
Add a comment  | 

1 Answer 1

Reset to default 0

From your post it sounds like you might want to use qz for your browser printing needs, its easy to setup. Browsers behave differently when it comes to printing.

It can allow you to detect your printers, and connect using a small Javascript that can be embedded on your web page.

本文标签: javascriptPrinting a PDF from within a browser to named client printer in Windows 1011Stack Overflow