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

PrintToPdfAsync() when printing PowerBi report produces empty pdf #3749

Open
v4sil-k opened this issue Aug 30, 2023 · 3 comments
Open

PrintToPdfAsync() when printing PowerBi report produces empty pdf #3749

v4sil-k opened this issue Aug 30, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@v4sil-k
Copy link

v4sil-k commented Aug 30, 2023

When invoking from c# code the Microsoft.Web.WebView2.Core.CoreWebView2.PrintToPdfAsync(string ResultFilePath, CoreWebView2PrintSettings printSettings = null)

It produces empty pdf. The only visible thing in the pdf is the iframe border. The same iframe that contains the embeded powerbi report. If I right click somewhere on the loaded page and from the context menu I select "Print" option and then from the Printer selection dropdown I choose the "Save to PDF" then I am able to save the same powerbi report in pdf file which has all the content of the report.

@v4sil-k v4sil-k added the bug Something isn't working label Aug 30, 2023
@vickiez
Copy link
Contributor

vickiez commented Aug 30, 2023

Hi @v4sil-k, we are tracking a few similar requests in #1990, #2949, and #3563. Do any of those address your concern?

@v4sil-k
Copy link
Author

v4sil-k commented Aug 31, 2023

Hi @v4sil-k, we are tracking a few similar requests in #1990, #2949, and #3563. Do any of those address your concern?

Hi @vickiez, yes indeed, it looks like those are very similar if not the same as the problem I am facing. Do you know of any progress on these mentioned issues?

By the way, may I suggest something - this is for the developers of course. As I already mentioned when you invoke the print dialog from the popup menu and choose the "Save as PDF" in the printer dropdown - it works! I need to clarify something here! This option "Save as PDF" is not the same as the printer: "Microsoft Print to DPF"- which one you may need to install as a windows feature. The options "Save as PDF" is there in the dropdown no matter you have the mentioned printer installed or not. Which leads me to the conclusion that this option is browser provided (in our case WebView2 provided) If we were able to programmatically set this "printer" option in the printer name when we provide printer settings to the print(..) method, along with file name of course (this last one is not an option in the printer settings) so if we were given this functionality we are good to go as I already mentioned this produces PDF that is OK. I hope I was clear.

@vickiez
Copy link
Contributor

vickiez commented Sep 8, 2023

@v4sil-k that work has been lower priority unfortunately, but you can add feedback to existing issues to help boost them.

Adding Save As PDF to our Print API wouldn't automatically work for your scenario because our Print APIs only apply to the WebView object, not any frames. (Our PrintToPDF API works the same way as Save As PDF, but it's also only available on the WebView).

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

No branches or pull requests

2 participants