问题
Am developing an application using UWP. I need to add PRINT feature.I have sample code to print. It is showing Print Popup dialoag.But Can any one suggest how to print with out that print popup. How to do it programmatically click Print button.
回答1:
In UWP app if you want to use a Windows Driver Printer than I am sorry the only option is to print using the Print Popup dialog.
If you want to print to a specific printer without print dialog then there are two ways-
- The printer should be OPOS based and you can use PosPrinter class to print to a specified printer(This uses OPOS drivers)
- If you want to use Windows driver printer then you need to use Windows brokered component and then use the classic .NET code to provide a wrapper to print to a specific printer, but you need to have your app through sideloading.
I hope this solves your problem.
来源:https://stackoverflow.com/questions/46644492/uwp-print-with-out-printer-popup-dialoag