Open icnocop opened 1 year ago
I'm trying to print webview2 in UWP app when I use _webView.CoreWebView2.ShowPrintUI(CoreWebView2PrintDialogKind.System); it alert me with this message "Check your printer or select another printer. The printer you chose isn't available or isn't installed correctly."
can you help me in this
@Marim99 Unfortunately, at the moment its a known limitation that printing in a UWP app is not supported. This is described a bit more in the WebView2 WinUI2 doc.
We are tracking this issue in https://github.com/MicrosoftEdge/WebView2Feedback/issues/3135. Feel free to add any additional feedback there. Thanks!
Description
The browser's print preview dialog window is not displayed for a hidden browser window control.
It works as expected when using the system's print preview dialog.
Version
SDK: 1.0.1661.34 Runtime: Version 111.0.1661.62 (Official build) (64-bit) Framework: WPF OS: Windows 10 Enterprise x64 22H2 OS Build 19045.2728
Repro Steps
Add a hidden browser control to a WPF window:
<wv2:WebView2 Visibility="Hidden" x:Name="browserForPrinting" />
Try to display the browser's print preview dialog:
browserForPrinting.CoreWebView2.ShowPrintUI(CoreWebView2PrintDialogKind.Browser);
I expected the browser's print preview dialog to be displayed in a modal popup window.
It works as expected when using the system's print preview dialog:
browserForPrinting.CoreWebView2.ShowPrintUI(CoreWebView2PrintDialogKind.System);
Thank you.