PWB CEF PDF viewer print and download buttons

Questions and comments about currently under development PWB v3

Moderators: Tyler, Scott

Post Reply
timh
Contributor
Contributor
Posts: 24
Joined: Tue Mar 14, 2006 7:50 am

PWB CEF PDF viewer print and download buttons

Post by timh »

Hi Scott,

Using PWB CEF 3.0.5.0 with all the print buttons and options in the ini file set to False: When viewing a PDF file with the built-in PDF viewer the Print button is still present. We would very much like to be able to hide/disable this print button and the download button as we do with the same functionality in the main PWB menus and buttons.

The CEF developer forums indicate they can be removed when compiling CEF but is there anything you can do to make them sensitive to switches in the PWB ini file?

With thanks,

Tim

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: PWB CEF PDF viewer print and download buttons

Post by Scott »

The Chrome PDF viewer is part of Chrome via the and is independent of PWB.

Unfortunately we do not compile CEF from source, PWB uses the binary distribution of CEF.

It is possible to provide your own PWB CEF PDF viewer with the following undocumented INI settings.

[PDFViewer]
EnablePDFViewer=false
PDFViewerPath=
PDFViewerArguments=
ShowMaximized=false
ShowModal=false

--Scott

timh
Contributor
Contributor
Posts: 24
Joined: Tue Mar 14, 2006 7:50 am

Re: PWB CEF PDF viewer print and download buttons

Post by timh »

Thanks for the speedy response Scott,

I'll have a look at specifying SumatraPDF as the PDFViewer with a sumatrapdfrestrict.ini set to deny print and save for this particular usage.

Presumably you usage of CEF means that one could, in theory, compile one's own version of CEF and run PWB with that just by substituting the binaries for those in the PWB distribution or indeed, update the Chromium version independently of PWB by taking the CEF binary distribution directly and doing the same substitution?

Best regards,

Tim

timh
Contributor
Contributor
Posts: 24
Joined: Tue Mar 14, 2006 7:50 am

Re: PWB CEF PDF viewer print and download buttons

Post by timh »

Hi Scott,

[PDFViewer]
EnablePDFViewer=true
PDFViewerPath=C:\SumatraPDF\SumatraPDF.exe
PDFViewerArguments=
ShowMaximized=false
ShowModal=false

Opens SumatraPDF empty, what do I need to put as the PDFViewerArguments to pass it the location+file name (presumably in the temp/cache directory) of the PDF file?

Thanks,

Tim

timh
Contributor
Contributor
Posts: 24
Joined: Tue Mar 14, 2006 7:50 am

Re: PWB CEF PDF viewer print and download buttons

Post by timh »

I think I found the answer myself

[PDFViewer]PDFViewerArguments=%1

seems to work (unless it's a happy accident and not going to work going forward)

Tim

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: PWB CEF PDF viewer print and download buttons

Post by Scott »

That should work. Adding the arguments allows PWB to pass the URL to the PDF viewer.

--Scott

timh
Contributor
Contributor
Posts: 24
Joined: Tue Mar 14, 2006 7:50 am

Re: PWB CEF PDF viewer print and download buttons

Post by timh »

I know this feature was undocumented but has it been dropped or stopped working?
The department where we were using this have noticed that (presumably since some intervening PWB upgrade) PDF's are loading in the internal PDF viewer rather than the specified external viewer.
I have just tested with the new 3.05.6 release and got these results:

[PDFViewer]
EnablePDFViewer=True
PDFViewerPath=C:\SumatraPDF\SumatraPDF.exe

The built-in PDF viewer runs in a Second window with no PWB bars etc., stays on top

[PDFViewer]
EnablePDFViewer=False
PDFViewerPath=C:\SumatraPDF\SumatraPDF.exe

The built-in PDF viewer runs in the First window

In neither case does SumatraPDF run. The PDFViewerPath string is definitely correct: copy & paste to a command line runs it with no problem.

Regards,

Tim

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: PWB CEF PDF viewer print and download buttons

Post by Scott »

The setting is still available. Try adding the following to your INI file.

[PDFViewer]
UseInternalViewer=False

Please note, if the web site is not presenting the PDF file with a "PDF" file extension the external application will not open it.

--Scott

timh
Contributor
Contributor
Posts: 24
Joined: Tue Mar 14, 2006 7:50 am

Re: PWB CEF PDF viewer print and download buttons

Post by timh »

Perfect, just like magic!
Oddly, I had tried "pwb --disable-pdf-extension" in combination with the .ini declarations, which did what it said but still didn't run the external viewer program, just opened an empty second window. It really is good to have a programmer who talks directly to users.

Thanks again,

Tim

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: PWB CEF PDF viewer print and download buttons

Post by Scott »

You welcome.

We use PWB in our own facilities for general public use so if there is an issue we are usually on top of it.

--Scott

Ethel11
Spectator
Spectator
Posts: 1
Joined: Mon Jul 06, 2020 1:31 am

Re: PWB CEF PDF viewer print and download buttons

Post by Ethel11 »

Using PWB CEF 3.0.5.0 with all the print buttons and options in the ini file set to False: When viewing a PDF file with the built-in PDF viewer the Print button is still present. We would very much like to be able to hide/disable this print button and the download button as we do with the same functionality in the main PWB menus and buttons.
John

Scott
Site Admin
Site Admin
Posts: 2539
Joined: Mon Dec 16, 2002 12:31 pm
Location: Rochester, MN
Contact:

Re: PWB CEF PDF viewer print and download buttons

Post by Scott »

It is not possible to disable the print button in the default Chrome PDF viewer.

You can use the PWB Execute filter to open the PDF file in an application of you choice.

For example the Sumatra PDF viewer:
https://www.sumatrapdfreader.org/downlo ... iewer.html

PWB Execute filter:
https://www.teamsoftwaresolutions.com/f ... 256&p=8059

--Scott

Post Reply