WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

[Problem/Bug]: Method ICoreWebView2.Print() don't work if using page ranges

Open MLAEO02 opened this issue 1 year ago • 6 comments

What happened?

In my company we use the Print() method to print documents. The problem arises when we set a page range in the ICoreWebView2PringSettings class that starts with 4 or higher. For example:

  • Range "1": work
  • Range "1-10": work
  • Range "4-10": don't work
  • Range "5": don't work

When we send the print with a "problematic" range, the document is not printed. Furthermore, if we open a new instance of WebView2, it remains gray without showing any sign of life. From the task management detail, we see a msedgewebview2.exe process that was started with the "--utility-sub-type=network.mojom.PrintService" parameter and which remains active even after starting printing. As long as it is not killed manually, the WebView2 component is no longer instantiated and, for this reason, subsequent startups remain gray. Once killed manually, after 2-3 minutes other msedgewebview2.exe processes automatically die. Subsequently, the behavior becomes correct again: the WebView2 component can be instantiated again and allows us to correctly view the documents.

What could be the problem?

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

126.0.2592.87

SDK Version

4.6.01055

Framework

Other

Operating System

Windows 10

OS Version

No response

Repro steps

  1. Set any printer in ICoreWebView2PrintSettings class
  2. Set a range of pages in the ICoreWebView2PrintSettings class: the range must have a starting value equal to or greater than 4
  3. Send the printing of any document via the CoreWebView2 16.Print() method

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Regression in newer Runtime

Last working version (if regression)

Before 126.0.2592.87

AB#52577196

MLAEO02 avatar Jul 09 '24 10:07 MLAEO02

@MLAEO02 do you have an idea of what's a previously working version?

victorhuangwq avatar Jul 15 '24 16:07 victorhuangwq

Hi @victorhuangwq, sorry but no, I have no idea. We encountered this problem recently, so I don't know how long this problem has been around.

MLAEO02 avatar Jul 16 '24 06:07 MLAEO02

@MLAEO02 the reason I asked was because you mentioned in the report that this is a regression - meaning that at some point in time, this was working. Is that true?

victorhuangwq avatar Jul 16 '24 17:07 victorhuangwq

Thank you for reporting the issue. I’ve successfully reproduced it locally and added it to our backlog. We'll investigate and provide updates in this thread once the fix is ready

monica-ch avatar Jul 16 '24 22:07 monica-ch

@victorhuangwq yes, the problem was reported to us only recently, by a user using the 126.0.2592.87 version. I personally tried the feature a while ago and it worked, but I don't remember which version i used. @monica-ch good! Thank you so much! Keep me updated if you can, please

MLAEO02 avatar Jul 17 '24 06:07 MLAEO02

✅ Successfully linked to Azure Boards work item(s):

champnic avatar Jul 18 '24 17:07 champnic