Latest PHPDekstop Version does show color print options in the dialog - but print is ony b/w

62 views
Skip to first unread message

ser...@allgaeu-informatik.de

unread,
Jan 27, 2020, 11:56:58 AM1/27/20
to PHP Desktop
I'm using PHPDesktop to forward to several websites.

The problem with only b/w printing happens on all sites - color option in the print dialog enabled.
I'm completely clueless if you guys tell me that it works for you.



Czarek Tomczak

unread,
Jan 27, 2020, 3:45:04 PM1/27/20
to PHP Desktop
I've asked you to provide more information and you ignored it. Try printing in Google Chrome on that same machine. Try printing on a different computer with a different printer.

ravec...@gmail.com

unread,
Jan 27, 2020, 4:50:23 PM1/27/20
to PHP Desktop
We tried this on 3 different machines. Chrome does print correctly. I've tried a pdf printer and a canon laster printer.
Chrome does it right. PHPDesktop does not print background colors .(But then there's also an option to turn on background colors when printing).

OS is always Windows 10.  PHP Desktop version is v.57 for windows.

Czarek Tomczak

unread,
Jan 27, 2020, 6:22:30 PM1/27/20
to PHP Desktop
This might be fixed in latest Chromium Embedded Framework (CEF). You can test by downloading sample CEF app from here: http://opensource.spotify.com/cefbuilds/cef_binary_79.1.31%2Bgfc9ef34%2Bchromium-79.0.3945.117_windows32_client.tar.bz2

If it works fine with CEF it will work fine in PHP Desktop when we update Chromium engine to latest CEF version. Currently we embed old version v57.

ravec...@gmail.com

unread,
Jan 28, 2020, 1:27:06 PM1/28/20
to PHP Desktop
This is the correct print created by Standard Chrome and also similar on Firefox.

screenshot_156.png


And this is what the CEFClient and PHPDesktop is generating...

screenshot_157.png


When printing colors graphs or timecharts it's important to have not only fore- but also the background colors printed out.
Any idea what's going on here?

Czarek Tomczak

unread,
Jan 28, 2020, 1:30:00 PM1/28/20
to PHP Desktop
I've already answered you. Looks like a bug in old Chromium version.

ravec...@gmail.com

unread,
Jan 28, 2020, 1:36:27 PM1/28/20
to PHP Desktop
Hi again. It's not a bug - I think it's a missing feature that can be enabled on a standard chrome or firefox browser:
The following setting can be set in standard chrome, but has no current equivalent in PHPproject:

screenshot_158.png




Czarek Tomczak

unread,
Jan 28, 2020, 2:29:58 PM1/28/20
to PHP Desktop
I already told you to test latest CEF sample application to see how it behaves. Otherwise all you make is just guesses.

ravec...@gmail.com

unread,
Jan 28, 2020, 2:38:17 PM1/28/20
to PHP Desktop
Well but I've already told you the results before. CEF behaves exactly the same as before - no background graphics is being printed.

Czarek Tomczak

unread,
Jan 28, 2020, 3:00:10 PM1/28/20
to PHP Desktop
Please also test CEF cefclient sample application with the print preview experimental feature. You can enable it by passing special flag: “cefclient --enable-print-preview”.

CEF has API to print to PDF and when doing so it has an option to enable background graphics: https://github.com/chromiumembedded/cef/blob/b51a4de540c6cf076f563a9efa5d4c9ffc13e719/include/internal/cef_types.h#L2458 .
In such case we could implement a feature that prints to PDF and then calls a system print dialog to print that PDF file. Such API could be exposed to Javascript: e.g. phpdesktop.PrintWithOptions().

Test also if applying this CSS can fix your issue:
body {
    -webkit-print-color-adjust: exact;
}

Is your issue colors not printed (title) or is your issue background graphics not printed? Or both?

ser...@allgaeu-informatik.de

unread,
Jan 30, 2020, 9:22:35 AM1/30/20
to PHP Desktop
I'll test the commandline switch tonight.

Regarding your question: The issue is that only background graphics are not printed.
In my case most statistic bars and timelines are background colors, so colored titles are ok.

ser...@allgaeu-informatik.de

unread,
Jan 30, 2020, 9:29:14 AM1/30/20
to PHP Desktop
Hi Czarek,

the switch for cefclient --enable-print-preview works. The print preview is of course an elegant solution and when I enable
the background-color print the client even rembers the settings I've last used.

Is a similar switch available in the last PHPDesktop as well?
Cheers

ravec...@gmail.com

unread,
Jan 30, 2020, 9:45:51 AM1/30/20
to PHP Desktop
Making a quick css patch via developer tools with  -webkit-print-color-adjust: exact;
seems to work similary, but the print has some flaws and for example some background colors are rendered
without the overlaying fonts. So "exact" is not really what happens.

The solution with --enable-print-preview like in the cefclient is far more sophisticated because it also
allows us to set the quality, margins, scale (very important) and others, while at the same time presenting
us with the preview itself. 

So this would enhance PHPDesktop greatly beside the background colors being printed.
Can the new cef be integrated into PHPDesktop without problems?

Czarek Tomczak

unread,
Jan 30, 2020, 8:21:46 PM1/30/20
to PHP Desktop
The print preview feature is only available in latest CEF. There is an ongoing funding to update PHP Desktop to latest CEF on Windows. Details in Issue #227.

Czarek Tomczak

unread,
Jan 30, 2020, 8:24:33 PM1/30/20
to PHP Desktop
Sure, PHP Desktop can be updated to latest CEF.
Reply all
Reply to author
Forward
0 new messages