See also the old Print feature request GitHub thread. For example if in the following the webview2 is the WPF WebView2 class:Īwait ("window.print() ") This has the limitations that it only works for HTML documents (not PDF for example) and only when script is enabled in the document. Script injection: If the experimental APIs aren't practical for you to use yet, as a workaround for HTML documents you can inject script that calls the DOM print method.(The stream version of this method is currently experimental and only available in the prerelease SDK). To completely control how printing is performed, you can print to a PDF and then build your own code to print the PDF. ![]() CoreWebView2.PrintToPdfAsync/ PrintToPdfStreamAsync: Silently print the current top-level document in the WebView2 to a PDF file or PDF stream. ![]() (This method is currently experimental and only available in the prerelease SDK).Īwait (null) If you want to build your own print preview dialog or otherwise build your own print experience you can use this method. Head over to the folder where you have saved all your PDFs that need to be printed. Step 2: Upload PDFs Click on select files.
0 Comments
Leave a Reply. |