Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

DECF3 PDFViewr File Save and Print buttons

Post Reply
jbarr2023
Posts: 1
Joined: Wed Mar 29, 2023 11:42 am

DECF3 PDFViewr File Save and Print buttons

Post by jbarr2023 »

I am using DCEF3 with Delphi 10.42. We have a TChromium component on a form and when a PDF is opened it is loaded into the Chromium PDF Viewer. A menu displays at the top of the pdf page with the name of the file, Page number, Rotate, File Save and Print buttons. There is an OnFileDialog event in TChromium that I put a message in, when the user clicks the File Save button the message displays. I would like to do the same thing when the user clicks the print button. I want to catch the click and cancel the printing to resend it to a print method we have to do the printing. I tried various events but cannot catch the print click on the PDF drop down menu. I see in the CEFlib there are print methods on_print_start, on_print_dialog and others. Can these be exposed to catch the print click from the PDF Viewer?

Thanks
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: DECF3 PDFViewr File Save and Print buttons

Post by salvadordf »

Hi,

Those events only work in Linux. There's no event in DCEF3, CEF4Delphi or WebView4Delphi that can do what you describe.

If you only use the browser as a PDF viewer I would try a different component like :
  • https://github.com/tothpaul/PDFiumReader
  • https://github.com/ahausladen/PdfiumLib
Post Reply