PDF Plugin - Print Button

32 views
Skip to first unread message

Etienne

unread,
Sep 6, 2022, 11:27:24 AM9/6/22
to CEF Python
I have a PDF Viewer by embedded cefpython3 V66.1 in a PyQt app which generate automatic reports. I need to control when a pdf file is saved and I would like to prevent users from pressing the "print" button from the toolbar of the PDF Plugin. I tried by executing a javascript code on DOM ready overriding the window.print function but that's not working, when I inspect the HTML generated I see an embed tag only, so I can't hide the button by executing 'getElementByID(...).style.visible'. Is there a way to do that? I achieve to disable downloads by adding the key/value to the 'settings' dict and passing it to the cef.Initialize but i didn't find a similar solution for the print button.

Thanks in advance!
Reply all
Reply to author
Forward
0 new messages