-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for printing content of a webview. #7
Comments
Thanks for your feedback. You can use CapturePreview to capture an image of what WebView is displaying. Will that work for your scenario? |
Thanks for the suggestion, but no it doesn’t work well, especially if it is a multipage document, the CapturePreview becomes cumbersome and often doesn’t look very good.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
…________________________________
From: lingamy <notifications@github.com>
Sent: Friday, May 10, 2019 9:02:12 AM
To: MicrosoftEdge/WebViewFeedback
Cc: mobiletonster; Author
Subject: Re: [MicrosoftEdge/WebViewFeedback] Support for printing content of a webview. (#7)
Thanks for your feedback. You can use CapturePreview<https://docs.microsoft.com/en-us/microsoft-edge/hosting/webview2/reference/iwebview2webview#capturepreview> to capture an image of what WebView is displaying. Will that work for your scenario?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#7 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AA3SFVL3H4AULHGCUXJNT63PUWMAJANCNFSM4HMABPLQ>.
|
Thanks for providing additional details. We'll look into how to meet the requirement for your scenario. |
Hey @mobiletonster , I'm the developer looking into this feature request. Just trying to get more information from you. Can you tell me more about what you need this feature for? You mentioned Spartan WebView printing support which was complicated to hook up to UWP/WinRT printing support, do you mean a similar functionality to hook up to UWP printing APIs? Thank you! |
Yes, thank you very much for looking in to this feature. We build an application (UWP) which displays content formatted in HTML. As part of this app, we allow users to annotate and highlight, add notes, tags, etc. to the content for study purposes. The users often want to print the content along with their annotations. We use the webview control to display this content and would love to be able to print the content directly from the webview control as it is displayed on the screen. Today, we export the html, css, etc. to a local file on disk and invoke the default web browser then invoke a print command via injected Javascript...problem is, it only works part of the time and isn't always as precise as what we display within the application. Printing directly from UWP is currently very cumbersome and rarely works well. If you would like to try the app, download Gospel Library from the Microsoft Store and try it out. Thanks. |
Thanks for the context @mobiletonster !
If you don't mind me asking, why are you going through this? Would injecting a script to WebView directly to invoke |
Currently, the UWP or EdgeHTML WebView provides no printing support. invoking window.print doesn't actually do anything in the WebView control. Worse yet, in later version of Edge, you can no longer export your HTML/CSS to the file system and invoke a window.print due to security updates. Chrome, Firefox do still support it, so if your default browser is not Edge, it will still work. The print capabilities of the browsers are already very good (and support @media print CSS directives). To reproduce all of that capability ourselves in our app is not practical. We would prefer to access the native print capabilities of the new (or even existing) Edge browser and invoke it directly from our app/WebView control...in otherwords, be able to print what is currently loaded in the WebView control....just as the browser would do. Thanks. |
Here are links to other people searching for the ability to print from the webview control to provide more context to the issue. https://stackoverflow.com/questions/39012591/uwp-print-webview https://www.suchan.cz/2016/04/make-webview-great-again/ |
Thanks for all the links and bringing this up. I wasn't aware For the WebView2 we're building though, you can use
|
That looks promising! As long as we can invoke the webview's print api's, then that would be perfect! |
Great! I think the issue is resolved at this point, but feel free to reopen if you have additional comments on this topic. |
the platform has requests around converting html or other web content into pdf, which would benefit from this feature being implemented. See microsoft/react-native-windows#7723 |
Unlike WebView(EDGEhtml), please, please support printing of contents of a webview. All the crazy gyrations needed to print webview content in a UWP application today doesn't work well.
Thanks for your consideration.
The text was updated successfully, but these errors were encountered: