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 does not work as expected

Post Reply
KessiJones
Posts: 5
Joined: Wed Apr 28, 2021 12:05 pm

Print preview does not work as expected

Post by KessiJones »

Hello,

I work with the DCEF3 in Dre version 89.0.18 and have a problem with the print preview.

In the source code I set the parameter

Code: Select all

GlobalCEFApp.EnablePrintPreview: = True;
   GlobalCEFApp.EnableGPU: = True;
Our application shows an email preview via the Chromium integration.
There I now have the option to call up the print preview with the right mouse button. This works so far and the preview opens in a popup window. It shows more than expected, but that is a minor matter.
There is also a print button in this window which, without EnablePrintPreview, also brings up a print dialog. Now you can print once and the Chromium window crashes.
Now you can print once and the Chromium window crashes.

With PrintPreview the white pop-up window opens without any content and the application freezes.
I have NO influence on the way the print button is used.
Does anyone have any idea what I'm doing wrong?

My Startup-Code is the following:

Code: Select all

    GlobalCEFApp := TCefApplication.Create;
    GlobalCEFApp.FrameworkDirPath := 'CEF4Runtime';
    GlobalCEFApp.ResourcesDirPath := 'CEF4Runtime';
    GlobalCEFApp.LocalesDirPath := 'CEF4Runtime';
    GlobalCEFApp.FlashEnabled := False; 

    GlobalCEFApp.EnablePrintPreview := True;
    GlobalCEFApp.EnableGPU := True;

    GlobalCEFApp.SitePerProcess := False;
    GlobalCEFApp.EnableMediaStream := False;
    GlobalCEFApp.EnableSpeechInput := False;
    GlobalCEFApp.EnableHighDPISupport := False;
    GlobalCEFApp.DisableSpellChecking := True;
    GlobalCEFApp.AddCustomCommandLine('--force-device-scale-factor', '0.8');

    GlobalCEFApp.SingleProcess := True;

    try
        if not GlobalCEFApp.StartMainProcess then
        begin
            Exit;
        end;
    finally
    	GlobalCEFApp.Destroy;
    	GlobalCEFApp := nil;
    end;
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Print preview does not work as expected

Post by salvadordf »

Hi,

The single process mode is not supported by CEF and it's known to cause some issues.
Try deleting the code line where you enable GlobalCEFApp.SingleProcess.
Post Reply