Show PDF in browser without printing or saving

Asked

Viewed 102 times

1

I need to view PDF documents in the browser window but I want them to be prevented from printing or recording. I don’t want to change one by one of the files by putting password and such, even because it can be broken. Can anyone suggest any technique or viewer that can be configured from PHP JS ?

1 answer

0


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

Remember that blocking the user too 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 disposition of your users.

To indicate to 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 instead of visa:

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

Quotes around the filename are required if the filename has special characters.

  • I agree with you, Renato, but that’s not why I’m leaving the key in the car contact. rss Your suggestion is already helpful, but the Acrobat plug-ins or Firefox itself, etc.. allow easy engraving or printing and can hinder these actions gained in security.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.