Saurabh Kedia
Saurabh Kedia

Reputation: 59

Disable pdf download and save option

I have a PDF file being viewed on the browser.

I want to disable Save, Download and print option of the PDF file.

Please help.

Upvotes: 3

Views: 38314

Answers (4)

Jean-Serge Gagnon
Jean-Serge Gagnon

Reputation: 9

As others have noted, once the pdf is being viewed by the user, they can save it.

If you are just wanting to obfuscate the download, you could disable the menu as described but to truly prevent downloading of the PDF, then only thing you could really do is a little crazy but not impossible.

You could convert it to images and show those instead. Not an ultimate solution as they would still be able to save each image, but at the very least they would not get a PDF file from it (or at least if they are smart enough to convert the images to one, it would not be the same pdf file or content)

There are many tools to do this and you'd have to implement a viewer with paging but this might achieve what you want.

Upvotes: 0

IlludiumPu36
IlludiumPu36

Reputation: 4304

Google Drive can disable the PDF functions to download, print and copy as of 2015.

Note however, that users can still print using the browser print function.

https://gsuiteupdates.googleblog.com/2015/07/disable-downloading-printing-and.html

I have many e PDFs via a HTML link to the general public which has this functionality.

Upvotes: 0

Try this:

<object width="100%" height="100%" type="application/pdf" 
data="yourpdffile.pdf#toolbar=0" id="pdf_content"><p>Document load was not 
successful.</p></object>

Make sure you add #toolbar=0 in the data attribute after your pdf file.

Upvotes: 2

Justinas
Justinas

Reputation: 43441

You can use iframe to your own version of PDF viewer.

Use pdfJS and when showing viewer.html just remove these buttons.


If user is viewing it on it's own tool, than you can't control it.

Upvotes: 0

Related Questions