Only disable Embeded PDF print and download options

705 Views Asked by At

I have a pdf viewer in place and want to disable the download and print options. I know, we can disable the toolbar by the appending the same after the pdf url "path-to-pdf/xyz.pdf#toolbar=0". But this disables all other options such as page numbers, bookmarks.

How to only disable download and print icons. Didn't succeed trying to do by hiding the icons in jquery.

Below is the code snippet for the PDF viewer:

<div id="Iframe-Master-CC-and-Rs" class="set-margin set-padding set-border set-box-shadow center-block-horiz"> <div class="responsive-wrapper responsive-wrapper-wxh-572x612" style="-webkit-overflow-scrolling: touch; overflow: auto;"> <object data="{{ file_path }}" type="application/pdf"> <iframe src="{{ file_path }}" style="border: none;"> This browser does not support PDF view. Please contact the administrator. </iframe> </object> </div> </div>

1

There are 1 best solutions below

0
On

How to only disable download and print icons?

You can't. When displaying a PDF using the object or embed tag, you are relying on the native browser or OS level PDF viewer to display the PDF. While Adobe Reader does accept parameters in the URL to control some aspects of the UI, not all viewers respect those parameters and you can no longer expect Adobe Reader to be the viewer that gets used. If you want to control the viewing experience, you'll need to control the viewer. Look at something like pdf.js or one of its equivalents.