I have a web application that produces various reports/documents/labels that need printing. Depending on the report a different local printer is used. Most go via the A4 laser, but some need to be printed on 1 of 2 different local label printers. Each PC can have different named local lable printers.
So far, the users have had to select the correct printer when printing. But having looked at WebView2 I thought I could use that in a c# windows forms app. My thought was that since the app would know what webpage is calling the print request, it could then direct it to the correct printer based on the url.
Does anyone know if this this is possible?
Or is there a way to direct a print job to a named printer when printing from the web? Short of installing a service on to each PC?
Edit: My question is clearly not clear. I know how to set the printer using c#, but I haven't used webview2 and wanted to know if the c# application would know or get what the current URL is with query string. I would like set the printer based on that.