Printing to PDF Produces Overlapped Content

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.

Printing to PDF Produces Overlapped Content

Postby habuleil » Tue Aug 08, 2023 6:12 am

Hi

I am using 115.3.9+gaa348cb+chromium-115.0.5790.99

I am having problem with the saved content when I save a pdf through a CEF based browser. This problem occurs with specific pdfs only.
The pdf I am using is made of 1 landscape page that has words and straight horizontal lines in it as content .

The Instructions I go through:
  1. Open the redirected PDF on a CEF based browser.
  2. Click on the "Print" button.
  3. Choose "Microsoft Print to PDF" as the printer.
  4. Click on "Preferences".

    1. Change the "Orientation" from "Portrait" to "Landscape".
    2. Click on "Advanced".
      1. Change the "Paper Size" from "Letter" to "A4".
      2. Click on "Ok".
    3. Click on "OK"
  5. Click on "Print".
  6. Enter any name and choose any path.
  7. Make sure that the type of the saved file is "PDF Document (*.pdf)"
  8. Click on "Save".
This results in a saved pdf in a Landscape Mode, A4 sized with the content I had but some of it (some straight horizontal lines) is placed on the wrong x/y coordinates (overlapped with other content -some words-) and the content (the straight horizontal lines) size got smaller.


Notes:
  1. I've tried running it with "--enable-print-preview", it didn't change the bad behavior.
  2. Running the same steps on a Stand Alone Chrome results in a good behavior.
Thanks in advance
habuleil
Newbie
 
Posts: 4
Joined: Mon Jun 05, 2023 4:30 am

Re: Printing to PDF Produces Overlapped Content

Postby Phylanx » Wed Aug 16, 2023 1:22 am

Hi!

We had similar problems with radio buttons, see: viewtopic.php?f=17&t=16664#p41385

Resulting in the following issue: https://github.com/chromiumembedded/java-cef/issues/341


Other related issues:
https://github.com/chromiumembedded/cef/issues/3063
https://github.com/chromiumembedded/cef/issues/2757

If I remember correctly, the problem was the usage of the css class "rgba".
Not sure anymore if using the alpha/opacity value was problematic or already the use of rgba, but this was the last hint.
Our customer didn't urge this issue further, so we dropped the problem where it was.
Phylanx
Expert
 
Posts: 201
Joined: Thu Aug 11, 2016 8:17 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 183 guests