Closed nicholas-brooks closed 5 months ago
An update on this:
We replaced the use of the PrintDialog with the following:
System.Drawing.Printing.PrinterSettings.InstalledPrinters
and send that to our SPA web-client (sent ahead of time)window.external.sendMessage(`{ "command": "print", "url": "http://../doc.pdf", "printer": "Epson Printer" }`)
We did this so we can now remember the selected printer for the particular document type the user prints as well as make it a more consistent ux experience for the user.
Hello! Awesome library I've stumbled across. Wish it was more well known.
I'm looking to allow a user to perform native printing from a Web-Client. Scenario: A customer needs to print out delivery dockets and performs this task 100's of times a day. Currently the web-application generates a PDF of the delivery docket, which the customer then opens in a separate browser tab, hits Ctrl+P to open the browser print dialog, then selects the Print button in browser print dialog. Not efficient for the user.
Ideally we want to speed this up for the customer so we're thinking of wrapping our SPA web-client in a Native windows application using Photino.NET. Then when the user wants to print the delivery docket:
window.external.sendMessage(`{ "command": "print", "url": "http://../doc.pdf" }\`)
PrintDialog
dialog.I've put together a test project to at https://github.com/nicholas-brooks/photino-dummy-print to demonstrate the part of prompting the user for the printer using
PrintDialog
Do you see any issues in doing so? I understand this ties the native-app to Windows, but for our scenario that is fine for now.
Note: I am not a WinForms expert at all so I'm probably missing lots of obvious issues here. I've done extensive Win32 coding via Delphi in the past, but most of my recent work is backend dotnet services and spa web-clients.