Skip to content Skip to sidebar Skip to footer

Showing Pdf On Web But Not Downloadable

I need to build a feature in my website to show pdf files. However i don't want them to be savable or downloadable. Is there a way to force browser to disallow saves and downloads

Solution 1:

No. If you see anything, it is yours. When you view a pdf file, the file contents are in your computer memory.


Solution 2:

Information can be made public or private. There is no in-between, and if you wish to change private data into public data there is no way to undo this change.

What you are saying is:

  • I want to send data to a remote computer, belonging to some user
  • I then want to limit what that remote computer can do with that data

The first part is what the internet does. The second part is not possible as you have no control over the running processes on the user's machine.

To be clear, in order to display a PDF file to the user, you must allow the user's browser to download that file in order to display it to the user. However whether the user chooses to write that information to the screen, or to a file, is beyond your control.

Your only option is to limit or mark the data you send to the user by perhaps flattening the PDF to a series of image files, or watermarking the PDF, although the user would still be able to save these images and you will be making it harder for people to read the documents you're trying to deliver. Or perhaps you could translate the PDF data into a series of javascript instructions before sending it to the browser, where this code may be executed and the PDF rendered to a canvas element. Even using this method, the user could take screenshots.

Here's the problem with the question: it puts the cart before the horse. You are not asking for a solution to a problem, but assuming the solution and asking for help with implementing it. Tell us the root problem - is it that you want to track how many times a PDF is viewed? Is it that you want to revoke access to a PDF at a later date? Perhaps these documents are reference material and you want to drive recurring traffic to your site? Or maybe the content is owned by a third party and there is some contractual stipulation regarding distribution? Without knowing this, we cannot offer a sensible solution to the problem you're facing.


Solution 3:

Maybe the buildin pdf right management is enougt for your needs. So the user can download the pdf but can't perform specific actions.

Another approach is to render the pdf into images, so the user can't download the whole pdf.


Post a Comment for "Showing Pdf On Web But Not Downloadable"