Printing HTML Elements with RGBA does not work

Having problems with building or using the JCEF Java binding? Ask your questions here.

Printing HTML Elements with RGBA does not work

Postby Phylanx » Tue Sep 10, 2024 3:59 am

Hi!

We have the problem that JCEF prints HTML incorrect if it contains elements with class "rgba".
Test HTML to reproduce this problem is attached: svgRGBA.zip

Current versions we can reproduce the problems with:
[*] 6261 (currently upgraded)
[*] 4147 (currently replaced by newer version)

Versions we reproduced the problem with earlier:
[*] 2704
[*] 3325
[*] 3683

I posted this problem already 5 years ago, see: https://www.magpcss.org/ceforum/viewtopic.php?f=17&t=16664&start=10, including an opened bug: https://github.com/chromiumembedded/java-cef/issues/341
What happened since then:
[*] Bug was rejected as "won't fix" because problem was suspected to be a part of the JVM or on another place outside of JCEF
[*] Reject was accepted because customer didn't urge the problem
[*] We upgraded JCEF internally to version 6261, problem still persists
[*] Customer urged this problem
[*] Also a similar bug appeared: printing PDFs with opaque graphics (eg in diagrams) have the same printing problem (printed smaller and on the upper left of the page)
[*] In the meanwhile user salvadordf also reported this problem in the thread. He could reproduce it in CEF with cefclient.exe if I understood it right.

How should we follow up on this?
Shall I report a bug on the CEF project?
Attachments
svgRGBA.zip
(479 Bytes) Downloaded 267 times
Phylanx
Expert
 
Posts: 212
Joined: Thu Aug 11, 2016 8:17 am

Re: Printing HTML Elements with RGBA does not work

Postby KatrinaS » Sat Sep 14, 2024 7:37 pm

Possibly have a play with the CefPrintSettings returned in CefPrintHandler, maybe they're screwed up in JCEF,, like 'Background graphics',, but they (SVG vector icons) do appear (in Edge print preview at least) even if this option isn't selected :)
KatrinaS
Mentor
 
Posts: 87
Joined: Tue Jul 04, 2023 6:30 pm

Re: Printing HTML Elements with RGBA does not work

Postby Phylanx » Mon Sep 23, 2024 9:35 am

Well, we're providing JCEF in Windows and if I recall correctly the CefPrintHandler is only supported in Linux and never called in Windows.
Am I correct?

// EDIT:
Also: The "background graphics" are not "not printed" they are printed smaller and on the wrong position.
Phylanx
Expert
 
Posts: 212
Joined: Thu Aug 11, 2016 8:17 am

Re: Printing HTML Elements with RGBA does not work

Postby KatrinaS » Tue Sep 24, 2024 6:17 am

Oh right,, you'd have to give me a few hours before I can try your HTML and print your page out of muh JCEF? :)

Obviously I don't have the 'real' page you are attempting to print correctly but on first impressions of the svgRGBA.html page you supply, you aren't quite using the SVG tag correctly, it's a temperamental thing, here's an example of how I'd do it just using one icon as example :

Code: Select all
<svg xmlns="http://www.w3.org/2000/svg" style="display:none;">
<symbol id="green-plus" fill="currentColor" viewBox="0 0 16 16">
<path d="m8 1c-3.866 0-7 3.134-7 7 0 3.866 3.134 7 7 7 3.866 0 7-3.134 7-7 0-3.866-3.134-7-7-7m-.813 3h1.656v3.188h3.156v1.656h-3.156v3.156h-1.656v-3.156h-3.188v-1.656h3.188v-3.188"></path>
</symbol>
<!-- Any number of Icons you like -->
</svg>
Graphic (+) working: <svg width="20" height="20" style="color:rgba(23,124,28,0.95);"><use href="#green-plus"</use></svg>


You'll have to excuse it if it doesn't quite work for you but I copied it out of another (my) page and adapted, it's basically the gist of it anyway :D Using your way the style information you supply might not set the size of the icon and yes it appears 'top' of the line-height (or similar) like in your supplied page. You could just use a CSS class to set wotevs. Hope this goes some way to explaining certain layout issues :)
KatrinaS
Mentor
 
Posts: 87
Joined: Tue Jul 04, 2023 6:30 pm

Re: Printing HTML Elements with RGBA does not work

Postby Phylanx » Wed Sep 25, 2024 1:17 am

If I had the HTML in my hand then I would do this willingly and would happy with it :D

My problem is that we have this bug when we present the page of a third party.
And that JCEF displays it correctly but only prints it wrong.

The HTML I provided just shows the core problem without me having to show real world (and information security relevant) data.
Phylanx
Expert
 
Posts: 212
Joined: Thu Aug 11, 2016 8:17 am

Re: Printing HTML Elements with RGBA does not work

Postby Phylanx » Mon Oct 14, 2024 1:39 am

In the meanwhile also a CEF4Delphi user reported problems with this (as mentioned of salvadordf).
So I guess the "JVM globally configuring something" might not be the problem (or the Delphi environment does the same).

We will start with investigating this bug next month but we don't have a clue where to start.

Can someone point me to a good direction?
Phylanx
Expert
 
Posts: 212
Joined: Thu Aug 11, 2016 8:17 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 20 guests