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

WebView2 PrintAsync prints the lowest DPI for virtual PDF printer #3709

Closed
Hedwig188 opened this issue Aug 14, 2023 · 4 comments
Closed

WebView2 PrintAsync prints the lowest DPI for virtual PDF printer #3709

Hedwig188 opened this issue Aug 14, 2023 · 4 comments
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@Hedwig188
Copy link

Hedwig188 commented Aug 14, 2023

Description
CoreWebView2.PrintAsync(printSetting) print blurring when passing virtual PDF printer as the printerName.
The default DPI is not populated from the virtual PDF printer, it always prints the lowest DPI(72) which results in the garbled PDF output.

Version
SDK: 1.0.1901.177
Runtime: Microsoft Edge WebView2 Runtime 115.0.1901.203
Framework: WPF
OS: Windows 10 Enterprise 19044.3208
.NET SDK 6.0

Regression
Was this working before but has regressed? Not sure

Repro Steps

  1. Checkout the code from here.
  2. Run the WebView2PrintDPIIssue solution.
  3. Save the PDF to file
  4. Check the print queue for "Adobe Print to PDF", noticed the pdf print job is generated with 72dpi instead of the default DPI sets on the virtual PDF printer.

image

It would be helpful if we can override the DPI value when creating CoreWebView2PrintSettings or have it fall back to the default DPI on the printer.

AB#46014376

@Hedwig188 Hedwig188 added the bug Something isn't working label Aug 14, 2023
@novac42
Copy link
Contributor

novac42 commented Aug 15, 2023

Thanks for reporting the issue and sorry you are running into it. I've assigned this to a dev who can help follow up on this.

@vickiez vickiez added the tracked We are tracking this work internally. label Aug 16, 2023
@fabiorocha fabiorocha assigned monica-ch and unassigned vickiez Aug 17, 2023
@monica-ch
Copy link
Contributor

@Hedwig188 Can you let me know on how you are checking the printed properties from Print queue? Also, what is the behavior you are seeing if printed from the browser?

@Hedwig188
Copy link
Author

Added some instructions below to check what DPI is used when printing to the PDF printer.

  1. Go to the "Printers & Scanners" settings from the window's search bar then click Manage for your PDF printer->Printer Properties->Advances->check Keep printed documents
    image
  2. Run the solution to print the document to the updated PDF printer
  3. Open the print queue for this printer, right-click on the last print job and select Properties
    image
  4. Go to the Layout tab->Advanced->Print Quality (the advanced options could be varies for different printers)
    image(https://user-images.githubusercontent.com/4316597/260538189-6377074b-48b0-4297-82e9-febd0d3f129a.png)
  5. See it prints the 72 DPI insteads of the default DPI configured on the printer

When I print from the Edge browser, the printer default DPI is being respected properly.
image

@monica-ch
Copy link
Contributor

@Hedwig188 This is now fixed in our Canary channel. Please test and let us know if you still see the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

4 participants