PDF print looks different (chrome vs cef)

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.

PDF print looks different (chrome vs cef)

Postby AlexMaptek » Mon Aug 26, 2019 10:47 pm

Hi, I have a WPF application that is using CefSharp to display PDFs to users.

It works well but an issue was discovered with the attached PDF when printing. On the second page there is a red dot with rings around it. If you print the PDF from chrome (I'm currently on 76.0.3809.100) the rings around the red dot print correctly. If however you print from the CefSharp (75.1.14) viewer the rings do not print.

There are also some more rings on the "Wet side lengths" legend on page 2 as well. These seem to be getting printed scaled down and offset left and up. Refer to images of printed PDFs:

Bad
Print_Bad.JPG
Print_Bad.JPG (64.94 KiB) Viewed 5654 times


Good
Print_Good.JPG
Print_Good.JPG (64.99 KiB) Viewed 5654 times


Any thoughts on what could be causing this?
Attachments
Water report.pdf
(93.28 KiB) Downloaded 489 times
AlexMaptek
Newbie
 
Posts: 2
Joined: Mon Aug 26, 2019 7:44 pm

Re: PDF print looks different (chrome vs cef)

Postby Czarek » Tue Aug 27, 2019 11:20 am

You are comparing different Chrome != CEF version. You can test with latest CEF by downloading "Sample application" from: http://opensource.spotify.com/cefbuilds/index.html
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: PDF print looks different (chrome vs cef)

Postby AlexMaptek » Tue Aug 27, 2019 8:52 pm

It is interesting - I downloaded the sample at 75.1.14 and it worked correctly.

I looked through the example code and it did not seem to be doing anything special relating to printing so I'm not sure what is going wrong.
AlexMaptek
Newbie
 
Posts: 2
Joined: Mon Aug 26, 2019 7:44 pm

Re: PDF print looks different (chrome vs cef)

Postby amaitland » Tue Aug 27, 2019 9:17 pm

You need to test with cefclient --multi-threaded-message-loop --off-screen-rendering-enabled --enable-gpu for a more accurate comparison of the WPF version.

What you are seeing maybe the same as https://github.com/cefsharp/CefSharp/issues/2409

If that is the case you may need to look at using a different CEF wrapper, CefGlue or ChromiumFx are alterntives
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 89 guests