Skip to content
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

PrintAsync prints blank page - WinForms VB.NET #3007

Closed
Desz5 opened this issue Nov 29, 2022 · 7 comments
Closed

PrintAsync prints blank page - WinForms VB.NET #3007

Desz5 opened this issue Nov 29, 2022 · 7 comments
Assignees
Labels
tracked We are tracking this work internally.

Comments

@Desz5
Copy link

Desz5 commented Nov 29, 2022

I have a question and i hope someone can help me:)
I load a page containing a label PDF and i would like to print it using the following command:

await WebView_Browser2.CoreWebView2.PrintAsync(PrintSettings)

I have the PrintSettings set to a number of Copies and PrinterName.
After the page is fully loaded i wait an additional 4/5 seconds to ensure everything is completely loaded.
But it prints a blank page/labels everytime.
The number of Copies work and it prints on the correct printer.
But everything is blank.
When trying a different printer it's the same issue, the number of copies work and the other printer, but still blank labels are printed, why?
When printing the page normally it prints correctly, also with ctrl+p and with await WebView_Browser2.CoreWebView2.ExecuteScriptAsync("window.print();")
When looking at the printerqueue the document when normal printed is about 8 kb, when using PrintAsync the document is 143 bytes, why?
Why wont it work with PrintAsync?
Is there something i'm forgetting or is it a bug?
Thank you!

AB#42451032

@Desz5 Desz5 added the question label Nov 29, 2022
@Desz5
Copy link
Author

Desz5 commented Nov 30, 2022

I see that it is a bug, same as this:
#1938

@monica-ch monica-ch added the tracked We are tracking this work internally. label Dec 1, 2022
@monica-ch
Copy link
Contributor

@Desz5 Current PrintAsync and PrintToPDFAsync doesn't support printing a PDF. I've added this bug to our backlog to correctly print PDFs. Thanks!

@Desz5
Copy link
Author

Desz5 commented Dec 1, 2022

@monica-ch Thank you!

@Desz5
Copy link
Author

Desz5 commented Jan 11, 2023

@monica-ch Is this something that will be fixed in the latest webview2 release?

@monica-ch
Copy link
Contributor

@Desz5 We are planning to investigate this in next couple of sprints. I'll update the thread when the fix is available.

@MikeCheel
Copy link

MikeCheel commented Jan 20, 2023

This also occurs for c# (since the title says VB.Net).

@monica-ch
Copy link
Contributor

monica-ch commented Feb 14, 2023

@Desz5 This is fixed in WebView2 runtimes 112.0.1675.0+. Please test using edge canary channel and let us know if you have questions.

Steps to test a WebView2 app using preview channels: https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/set-preview-channel

@champnic champnic closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

4 participants