Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Print Preview Crashes

win568neu
Posts: 11
Joined: Thu May 23, 2024 6:36 am

Print Preview Crashes

Post by win568neu »

With CEF 123.0.13/124.3.8 the Print Preview in the Print Dialog crashes. Are there any changes, that are necessary, that the Print Preview works ? If you press print, nothing happens.
User avatar
salvadordf
Posts: 4156
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Print Preview Crashes

Post by salvadordf »

Hi,

This is a known issue with the alloy runtime :
https://github.com/chromiumembedded/cef/issues/3697
https://github.com/chromiumembedded/cef/issues/3686

As you can see, the CEF project is moving to the Chrome runtime and old issues are marked as "not planned".

See the MiniBrowser demo to know how to set the Chrome runtime and wait until CEF 125 is released because it includes many fixes for the new Chrome runtime.
win568neu
Posts: 11
Joined: Thu May 23, 2024 6:36 am

Re: Print Preview Crashes

Post by win568neu »

Hi Salvador

Thanks for the hint. I looked at the information and the changes in the demos. Am I correct in assuming that tab support is not yet built in? We use our browser with multi-tab support and therefore it would not be possible to switch to ChromeRuntime. Is there still a way to re-enable printing without switching to ChromeRuntime?
User avatar
salvadordf
Posts: 4156
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Print Preview Crashes

Post by salvadordf »

Enabling the chrome runtime only requires a few minor code changes and you can use 99.9% of your code without modifications, including your existing multi-tab handling code.

The MiniBrowser demo is ready for chrome runtime and I'll modify a few more demos.

All the demos will use the chrome runtime by default in the future.
win568neu
Posts: 11
Joined: Thu May 23, 2024 6:36 am

Re: Print Preview Crashes

Post by win568neu »

Hi Salvador

I tried the ChromeRuntime in my project. We use the CEF framework with a Chrome subprocess exe. Unfortunately the Project did not recognize my SubProcess Exe and and starts the main exe with every Page. Do I also have to activate ChromeRuntime when initializing the CEF for the subprocess?
User avatar
salvadordf
Posts: 4156
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Print Preview Crashes

Post by salvadordf »

Yes. It's necessary to set GlobalCEFApp.ChromeRuntime to True in the main project and also in the subprocess project.

CEF4Delphi is now updated to CEF 125. Please, download the latest CEF4Delphi version from GitHub and see the changes in the TabbedBrowser2 demo.
win568neu
Posts: 11
Joined: Thu May 23, 2024 6:36 am

Re: Print Preview Crashes

Post by win568neu »

Hi Salvador

Thank you very much for your support
win568neu
Posts: 11
Joined: Thu May 23, 2024 6:36 am

Re: Print Preview Crashes

Post by win568neu »

Hi Salvador

The Subprocess with Chromeruntime works now. PrintPreview is also available and works with Version 125. Unfortunately the Download of Files did not work as before. If i want to Download a File, a Chromium Window with the Content of the File appears. Is there a possibility, to Download the Files like in the older version ?
win568neu
Posts: 11
Joined: Thu May 23, 2024 6:36 am

Re: Print Preview Crashes

Post by win568neu »

Hi Salvador

Further testing showed that the normal download of the files worked as always. However, if these are PDF files, the changes that I have adopted from the demos are no longer called up internally in the PDF viewer. The code in BeforePopup can be removed as the old behavior continues to work
User avatar
salvadordf
Posts: 4156
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Print Preview Crashes

Post by salvadordf »

Try setting TChromiumCore.DownloadBubble to STATE_DISABLED.

The old events to control the the downloads work but read the code comments for TChromiumCore.OnBeforeDownload to set the aResult value correctly. See the MiniBrowser demo.

Please, provide all the details about PDF issues to reproduce them in my computer.
Post Reply