Close button on pdf viewer

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.

Close button on pdf viewer

Postby saversa » Mon Dec 18, 2017 4:20 am

Hi,
I'm using CEF on Ubuntu inside an undecorated window (i.e. without close/resize/maximize window);
sometimes I have to host an external web page with links to a pdf resource to view in an external window:
the result is that a new undecorated window is opened with the pdf but noone can close that window.

I see that pdf rendering / view is made by a ppapi plugin and an html5 app:
I tried to modify the html5 app (inside chrome/browser/resources/pdf/elements/viewer-pdf-toolbar) adding a button to execute "window.close()" but the window isn't closed and the plugin freezes.

Is there a method to close the window hosting the pdf, inside pdf itself?
saversa
Techie
 
Posts: 11
Joined: Mon Jul 31, 2017 2:49 am

Re: Close button on pdf viewer

Postby HarmlessDave » Mon Dec 18, 2017 2:09 pm

If no one has a better suggestion, you could try using a decorated window just for PDFs.

If you can change the window style after creation, OnBeforeBrowse would let you check the URL though that will only catch URLs using .pdf instead of just a database ID. OnBeforePluginLoad() would be more reliable except that it doesn't tell you which browser ID is loading the PDF.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 63 guests