1

I have a html file with the following content:

<html>
<body>
<object data="https://upload.wikimedia.org/wikipedia/commons/0/09/America_Online_logo.svg" type="image/svg+xml"></object>
</body>
</html>

As you can check, you can open it with chrome and print it. But if I use Chromium.Print method, it print empty pages.

Note that this is only a sample. All SVG images had the same problem.

I use Delphi 10.3.2 and CEF4Delphi.

Can any one guide me?

4
  • And you really really really mean printing? Not rendering a PDF file?
    – AmigoJack
    Apr 9 at 21:32
  • Yes. I mean printing (I check it by Microsoft print to pdf and nitro pdf). Using Chromium printtopdf yields the same result, too.
    – aes temp
    Apr 10 at 1:11
  • So, the problem is not related to printtopdf method. It is related to print method, too.
    – aes temp
    Apr 10 at 1:18
  • Simply: * The web page is shown and printed correctly in browsers (Firefox,Chrome,...) * The web page is shown correctly but printed empty in Chromium.
    – aes temp
    Apr 10 at 6:31

1 Answer 1

2

This is very likely caused by the CEF issue #3297 and the workaround described in that report works.

Add this code line before the GlobalCEFApp.StartMainProcess call :

GlobalCEFApp.DisableSiteIsolationTrials := True;

I tested this workaround with the latest CEF4Delphi version which uses CEF 100.0.14 and the MiniBrowser demo. Your sample HTML is printed correctly with TChromiumCore.Print and TChromiumCore.PrintToPdf.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.