CEF printing error

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF printing error

Postby jmuehlner » Mon Jul 01, 2024 6:02 pm

Hello, I'm working on a headless application powered by CEF, and I'm currently working on implementing print support.

Using CEF version 126.2.6+gc7c4ac9+chromium_126.0.6478.115.

Using the print_to_pdf function works fine, it'll generate a PDF on disk as expected.
However, any sort of browser-induced printing, e.g. clicking the button here https://www.w3schools.com/jsref/tryit.a ... sref_print, fails with the following errors:

Code: Select all
[0701/215344.716848:ERROR:device_event_log_impl.cc(196)] [21:53:44.716] Printer: print_error_dialog.cc:61 The selected printer is not available or not installed correctly. Check your printer or try selecting another printer.
[0701/215344.725776:ERROR:canvas.cc(501)] NOTREACHED hit. Attempting to draw bitmap from an empty rect!
[0701/215344.725834:ERROR:canvas.cc(501)] NOTREACHED hit. Attempting to draw bitmap from an empty rect!


I can confirm that none of the handler methods in the print handler are called when printing fails in this way.

Does anyone have any idea what's going on?
jmuehlner
Newbie
 
Posts: 5
Joined: Mon Jul 01, 2024 1:29 pm

Re: CEF printing error

Postby magreenblatt » Mon Jul 01, 2024 7:05 pm

magreenblatt
Site Admin
 
Posts: 12754
Joined: Fri May 29, 2009 6:57 pm

Re: CEF printing error

Postby jmuehlner » Mon Jul 08, 2024 1:28 pm

Hmm, but that seems to be an issue when using the Chrome runtime, which I'm not using - I'm using Chromium/Alloy.

If chrome runtime is not enabled CefPrintHandler works fine.


This is certainly not the case for me.
jmuehlner
Newbie
 
Posts: 5
Joined: Mon Jul 01, 2024 1:29 pm

Re: CEF printing error

Postby magreenblatt » Mon Jul 08, 2024 2:10 pm

I'm using Chromium/Alloy.

What value for CefSettings.chrome_runtime?
magreenblatt
Site Admin
 
Posts: 12754
Joined: Fri May 29, 2009 6:57 pm

Re: CEF printing error

Postby jmuehlner » Tue Jul 09, 2024 11:58 am

magreenblatt wrote:What value for CefSettings.chrome_runtime?


We're using the CAPI: https://github.com/chromiumembedded/cef ... pes.h#L196

I don't see a `chrome_runtime` flag on the `cef_settings_t` type.
jmuehlner
Newbie
 
Posts: 5
Joined: Mon Jul 01, 2024 1:29 pm

Re: CEF printing error

Postby magreenblatt » Tue Jul 09, 2024 3:00 pm

The chrome_runtime setting has been deleted in master. Check sources for your branch version.
magreenblatt
Site Admin
 
Posts: 12754
Joined: Fri May 29, 2009 6:57 pm

Re: CEF printing error

Postby jmuehlner » Thu Jul 11, 2024 11:56 am

magreenblatt wrote:The chrome_runtime setting has been deleted in master. Check sources for your branch version.


Ah yes, there it is: https://github.com/chromiumembedded/cef ... pes.h#L244

It's set to 0.
jmuehlner
Newbie
 
Posts: 5
Joined: Mon Jul 01, 2024 1:29 pm

Re: CEF printing error

Postby magreenblatt » Thu Jul 11, 2024 12:12 pm

What OS are you using? CefPrintHandler is only supported on Linux.
magreenblatt
Site Admin
 
Posts: 12754
Joined: Fri May 29, 2009 6:57 pm

Re: CEF printing error

Postby jmuehlner » Fri Jul 12, 2024 11:50 am

magreenblatt wrote:What OS are you using? CefPrintHandler is only supported on Linux.


I'm using Linux. Ubuntu 22.04, specifically.
jmuehlner
Newbie
 
Posts: 5
Joined: Mon Jul 01, 2024 1:29 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 28 guests