Page 1 of 1

CEF 85: PrintToPdf no longer works for PDF files

Posted: Fri Sep 25, 2020 8:25 am
by wolf
When I load a PDF file, I could use PrintToPdf to save this PDF file to a folder. This worked fine until CEF 84, but no longer works in CEF 85. The saved PDF files no longer have the correct content.

Is this no longer possible in Chromium 85? Or do I just miss a flag or parameter to get this working again?

Tested with CEF 85.3.10

Re: CEF 85: PrintToPdf no longer works for PDF files

Posted: Fri Sep 25, 2020 11:11 am
by salvadordf
Apparently you're being affcted by this CEF issue :
https://bitbucket.org/chromiumembedded/ ... site-which

Try using the DevTools methods as the last comment says :
https://chromedevtools.github.io/devtoo ... printToPDF

The DOMVisitor and other demos have code examples about using similar DevTools methods. For example, this procedure executes the DOM.setAttributeValue method :
https://github.com/salvadordf/CEF4Delph ... r.pas#L913
https://chromedevtools.github.io/devtoo ... ibuteValue

Re: CEF 85: PrintToPdf no longer works for PDF files

Posted: Fri Sep 25, 2020 11:52 am
by wolf
Apparently you're being affcted by this CEF issue :
https://bitbucket.org/chromiumembedded/ ... site-which
Hmm, I don't think that I'm affected by this CEF issue.

Please try to load http://www.orimi.com/pdf-test.pdf in BriskBard 2.1, then call "Print to PDF". The generated PDF will not show the content.

Then try it again in BriskBard 2.0 and it should work correctly.

This started with CEF85, previous versions were OK.

Re: CEF 85: PrintToPdf no longer works for PDF files

Posted: Sat Sep 26, 2020 11:29 am
by salvadordf
I tested this with the official CEF sample application and it also generates an empty PDF.

I'll add an issue in the CEF project. Meanwhile, keep using CEF 84 if you need that feature.

Re: CEF 85: PrintToPdf no longer works for PDF files

Posted: Sat Sep 26, 2020 12:44 pm
by salvadordf
I added my findings to that CEF issue because the previous cefclient version (84) showed a print dialog when you tried to use the printtopdf function but now it creates an empty document. It seems to be the same issue but not completely fixed.
https://bitbucket.org/chromiumembedded/ ... site-which

If the CEF project maintainer thinks that it's a different issue he will ask me to create a new CEF issue at bitbucket.

Re: CEF 85: PrintToPdf no longer works for PDF files

Posted: Mon Nov 09, 2020 3:42 pm
by marcoscdoni
Hello, this problem still persists, correct?

I'm testing version 85 and the PDF appears blank, but if I click on the pdf the file is printed with the content correctly.

Re: CEF 85: PrintToPdf no longer works for PDF files

Posted: Tue Nov 10, 2020 9:21 am
by salvadordf
I'm afraid that the issue is not fixed in CEF 86. :oops:

The workaround works and you can print the PDF contents if you click on the document before printing.