-
Notifications
You must be signed in to change notification settings - Fork 480
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
windows: PrintToPDF and print preview requires additional PrintCompositorLPAC config in M125+ #3725
Comments
Does it fail on every page? can you access www.google.com and generate a PDF out of it? |
Yes, it fails on every URL that I try.
No, this fails. It also fails for other URLs I have tried, such as https://news.ycombinator.com |
Works fine for me in M126 and M127 on Windows 11.
What version, specifically, did you test? Are you passing any command-line flags to cefclient? |
Thank you for investigating this, Marshall. I just tested again with 126.2.10+g61241e4+chromium-126.0.6478.127, which I downloaded by going to the CEF builds page and clicking the link next to "Sample Application" from the "Current Stable Build" section for Windows 64-bit. I tested it on both Windows 11 and Windows 10 and found that the "Print to PDF" option failed for both. I didn't pass any command-line flags and am running cefclient.exe by double-clicking it. I attached a video from demonstrating this on Windows 11: demo.mp4If there's any additional info that would be helpful for me to send, please let me know. |
Thanks for the additional details. I can reproduce the issue with the 126.2.10 and 127.0.8 official Sample Application but not with a local CEF M127 build (Debug or Release). This suggests that the issue may be related to variations (features) that are enabled or disabled for non-Official builds only. This is what I see in chrome://version/ for my local M127 Debug build that appears PDF or printing-related:
However, running the Official M127 build with Here is the comprehensive list of M127 variations that are enabled in my working build in case someone wants to do a more exhaustive test of various feature flags to identify the culprit. |
Running cefclient with
This error does not appear with the local Release build so it's likely related. |
This fixes PrintToPDF and print preview for me in official M126 and M127: |
This can also be fixed by correctly setting permissions via icacls. See the related Chromium issue here. This is the preferred solution, and the same as Google Chrome's installer. |
See either of the above solutions. |
Thank you so much for pinpointing this, Marshall! This resolved the issue for me. I truly appreciate your help. |
Describe the bug
First, I want to say that I love CEF and hugely appreciate your immense amount of work on it. Thank you! I recently upgraded from CEF 111 to 125 and discovered that CefBrowserHost::PrintToPDF() now silently fails on Windows (it works correctly on macOS). By silently fails, I mean that the PDF is not created and the CefPdfPrintCallback isn't invoked. I then tested the Windows 64-bit builds of the cefclient application and found that starting with CEF 125, the "Print to PDF" option from the Tests dropdown fails silently, too (i.e. the PDF is not created and it doesn't show a UI dialog indicating that the PDF was created). Here are are findings testing with different versions of cefclient:
Do you have any ideas for how I can resolve this issue? The debug.log file for cefclient 125 doesn't appear to have any details about the error:
debug.log
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The PDF is created and cefclient displays a UI dialog confirming that the PDF was created.
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: