PrintToPDF() supports pdf printing?

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.

PrintToPDF() supports pdf printing?

Postby ninad3d » Mon Jun 08, 2020 8:38 am

I am new to CEF. I want to print a pdf file using CEF.

I have tried printing pdf file using PrintToPDF() but it's not working for me, I am using CEF-79.
Any help would be greatly appreciated.

eg-http://www.africau.edu/images/default/sample.pdf

Does PrintToPDF() supports pdf printing? if yes, in which CEF latest version it is supported?

Thanks in advance.
ninad3d
Techie
 
Posts: 20
Joined: Wed Mar 04, 2020 12:20 am

Re: PrintToPDF() supports pdf printing?

Postby magreenblatt » Mon Jun 08, 2020 3:12 pm

Do you want to display the print dialog, or not? If you want to display the dialog use CefBrowserHost::Print or window.print() JS code. If you want to print without dialog use CefBrowserHost::PrintToPDF. Note that there is currently a bug when using PrintToPDF with PDF files.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: PrintToPDF() supports pdf printing?

Postby ninad3d » Sun Jun 14, 2020 4:05 pm

Any estimate in which release this issue (#2790) could be fixed?
ninad3d
Techie
 
Posts: 20
Joined: Wed Mar 04, 2020 12:20 am

Re: PrintToPDF() supports pdf printing?

Postby amaitland » Sun Jun 14, 2020 5:20 pm

If you are simply trying to save the file to disk then you can implement cefdownloadhandler and call CefBrowserHosr::StartDownload to save the file.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: PrintToPDF() supports pdf printing?

Postby ninad3d » Mon Jun 15, 2020 3:48 am

No, I don't want to use StartDownload as it goes from multiple steps.
ninad3d
Techie
 
Posts: 20
Joined: Wed Mar 04, 2020 12:20 am

Re: PrintToPDF() supports pdf printing?

Postby amaitland » Mon Jun 15, 2020 4:51 am

It's a valid workaround and you may find it's your only option.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: PrintToPDF() supports pdf printing?

Postby ninad3d » Mon Jun 15, 2020 6:20 am

Thanks for the reply. As printToPDF() is not working for pdf files, I need to do a workaround of downloading it. if it is fixed, I will not have to download it.
that is the reason, we want to have this fixed.
ninad3d
Techie
 
Posts: 20
Joined: Wed Mar 04, 2020 12:20 am


Return to Support Forum

Who is online

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