Show PDF in browser without printing or recording

1

I need to view PDF documents in the browser window, but I want them to be prevented from printing or writing. I do not however want to change one by one of the files by entering password and such, because this can be broken. Can anyone suggest any technique or viewer that can be configured from PHP JS?

    
asked by anonymous 07.12.2015 / 01:26

1 answer

0

Unfortunately, this is not possible, since everything the browser displays can be downloaded in some way, you just need to know where to look and how to convert. But if you need to display in the browser only, the example below may help.

Remember that blocking the user from most is never a good idea, nothing will stop him from taking print and printing the prints. I've done it myself with hundreds of page e-books. Never doubt the willingness of your users .

To tell the browser that the file should be viewed in the browser:

Content-Type: application/pdf
Content-Disposition: inline; filename="filename.pdf"

To indicate that the file should be downloaded rather than viewed:

Content-Type: application/pdf
Content-Disposition: attachment; filename="filename.pdf"

The quotation marks surrounding the filename are required if the filename has special characters.

    
07.12.2015 / 13:49