Prevent PDF file from downloading and printing

I am trying to find a way to prevent a PDF from being printed or downloaded when view from web. Also, it is prefered that user cannot print screen. I am thinking about converting those PDF files to Flash. Any other ideas?

33.1k 20 20 gold badges 91 91 silver badges 102 102 bronze badges asked Feb 8, 2011 at 8:24 4,065 14 14 gold badges 50 50 silver badges 82 82 bronze badges pdf to flash is the best solution. Commented Feb 8, 2011 at 9:23

You do know that anything you display to the user can be printed in some fashion or another. If you serve it, they can find some way to use it.

Commented Feb 8, 2011 at 9:42

You can't stop a user from printing the screen. If you have information you want to display and you don't want it being printed physically, PDF isn't exactly the format of choice. It's whole purpose is to be lovingly printed.

Commented Feb 8, 2011 at 13:57

Yeah. sadly, the only way to ensure that something on your site can't be printed/saved/swiped in some way is to not put it on the site. no such thing as a totally secure system and all that.

Commented Feb 8, 2011 at 14:45

In my business, the need for the PDF to not be downloaded is due to not wanting customers to be able to easily share downloaded materials with other people. I make worksheets, and if they are easy to share, the customer is more likely to email them to a friend. If sharing them is made more complicated, they are less likely to want to go to the trouble. Not being able to download them without having advanced computer knowledge is good enough for me. Hope this sheds light on a need in the industry. Things like being able to get a screen shot, etc. are not a worry in my case. Hope this helps. I i

Commented Jul 29, 2017 at 17:55

12 Answers 12

Okay, I take back what I commented earlier. Just talked to one of the senior guys in my shop and he said it is possible to lock it down hard. What you can do is convert the pdf to an image/flash/whatever and wrap it in an iFrame. Then, you create another image with 100% transparency and lay it over top the iFrame (not in it) and set it to have a higher Z-value than the iFrame.

What this will do is that if they right click on the 'image' to save it, they will be saving the transparent image instead. And since the image 'overrides' the iFrame, any attempt to use print screen should be shielded by the image, and they should only be able to snapshot the image that doesn't actually exist.

That leaves only one or two ways to get at the file. which requires digging straight into the source code to find the image file inside the iFrame. Still not totally secure, but protected from your average user.

7,540 3 3 gold badges 44 44 silver badges 71 71 bronze badges answered Feb 8, 2011 at 14:59 guildsbounty guildsbounty 3,351 3 3 gold badges 23 23 silver badges 34 34 bronze badges

Browsers' developer tools make it trivial to get at anything sent to the user, and you're not going to stop screen capture programs. Heck, the user could use their mobile phone to take pictures of the computer screen…

Commented Jul 2, 2012 at 7:59 Right-click, view page source, get link of image under the transparent image. Done. Commented Aug 25, 2013 at 15:30

Using Firebug, you just inspect the transparent image, delete it & then print the page or save the image as you like, I think it's naive to think you can stop this. Your only option to secure this more is to make sure the images are watermarked (as @MarkRedman mentioned) so that you have an idea who printed this & when

Commented Mar 18, 2014 at 11:44

View Page Info > Media > Save As. It's been in Firefox for as long as I can remember. (I think I remember it existing in Mozilla Suite back before it got pared down into Firebird, which then became Firefox.) . and, yes, it's accessible without a context menu if you hit Ctrl+I or tap Alt to show the MacOS menubar outside MacOS and then look in the Tools menu. (Or click the site info block on the left end of the address bar, then click the ">" button and choose "More Information")

Commented Jan 17, 2017 at 2:58

@ssokolow Yep, I am aware of that workaround. I consider that under 'one of the ways of getting at it that requires digging into the source.' Your average user does not know the trick you just cited. I say you can lock it down 'hard' but not 'make it secure.' Because it's impossible to secure an image on a website. But. layering a transparent image over it is about the best you can manage. and will protect it from a typical internet user who knows Save As and Print Screen.

Commented Jan 20, 2017 at 15:00

Ultimately you will need to:

Keep in mind flash wont work on Apple devices if that's required.

A print screen will allow someone to recreate the low res image you present, and in this case you could add a watermark to the image.

141 9 9 bronze badges answered Feb 8, 2011 at 14:02 Mark Redman Mark Redman 24.5k 20 20 gold badges 95 95 silver badges 152 152 bronze badges

For anyone who reads this in 2017, be aware that browsers have functionality like Firefox's "View Page Info > Media" tab which allows downloading images presented through HTML and that efforts are being made to start phasing out plugins because they're too big a source of new security vulnerabilities. (I believe Chrome has currently removed support for all plugins but Flash and applied a whitelist for which sites are allowed to run Flash. mostly video-streaming sites.)

Commented Jan 17, 2017 at 2:54 I can download this file - it give download and also print options like normal pdf Commented Mar 31, 2021 at 6:45

That is not possible. Reading is downloading. When a user is reading a file, browser is downloading that file to temp. So even if you disable the download button, the user can click "File -> Save As" or copy that file from temp folder.

There are a few things you can do:

Method 1

The following code will embed a PDF without any toolbars and hide the print/download icons

 

Method 02

Right click on pdf and goto Share(below image)

enter image description here

Then go to Advanced option in left bottom

enter image description here

Tick Both check boxes. After copy embed link and paste it to your src . No download and Save drive option is not allowed

answered Nov 12, 2018 at 10:59 Jonathan Thurft Jonathan Thurft 4,163 8 8 gold badges 49 49 silver badges 78 78 bronze badges

#toolbar=0&navpanes=0&scrollbar=0 works on Chrome, but the toolbar is still displayed in Firefox. The user may also customize what program is used to display the PDF files to circumvent this "protection".

Commented Apr 13 at 12:38

If you encrypt the PDF you can control how printable and changeable it is.

  1. None
  2. Low res (150 dpi)
  3. high res (max dpi)

You can also prevent folks from copying/pasting from your PDF, and even do that while allowing screen readers access (visually impaired folks can still read your PDFs).

You haven't mentioned what you're using to build the PDFs so the details are up to you.

Alternative: You can create annotations that are only visible when printing. Create a solid box over the entire page that only shows up when printed -> No useful printing.

You might be able to do the same thing with layers (Optional Content Groups) as well, not sure.

answered Feb 8, 2011 at 19:41 Mark Storer Mark Storer 15.8k 3 3 gold badges 43 43 silver badges 82 82 bronze badges These permissions are ignored by browser-based PDF viewers. Useless. Commented Nov 13, 2020 at 22:09

Creating a video with QuickTime's screen capture or anything similar kind of defeats all the effort to protect your document file from being copied.

answered Apr 22, 2012 at 15:18 21 1 1 bronze badge

if you want to provide a solution, well, there just isn't one. You would have to be able stop the user running a program that can access the buffers in the GPU to prevent them grabbing a screen shot. Anything displayed on the screen can be captured.

If you decide to send a file where the contents are not accessible online, then you need to rely on the security that the end product/application uses. This will also be completely breakable for an extremely determined pserson.

The last option is to send printed documents in the post. The old fashioned way using a good courier service. Costs go up, time delays are inevitble - but you get exactly what you are after. A solution is not without its costs.

Always happy to point out the obvious :)

answered Feb 15, 2017 at 23:53 Captian Obvious Captian Obvious 21 1 1 bronze badge

I wish I had an answer but I only have Part of one. And I cannot take credit for it but the way to get it is below.
This is a more serious issue than it is being given credit for from the sound of the replies. Everyone is automatically assuming that the content that needs protection is for public consumption. This is not always the case. Sometimes there are legal or contractual reasons that require the site owner to take all possible measures to prevent downloading the file. The most obvious one I can think of has already brought up. The “Action Option Bar” presented by the browser to on almost any file you can left click.
Adobe DRM does nothing about that and worse, Adobe Acrobat cannot even have its own abilities to “Save” blocked as part of the “DRM” protection. This option comes up even in Reader no matter what other security selections you have chosen.

In our case, Adobe Acrobat was purchased solely to provide some degree of protection for their own format. It is hard to believe that Adobe will let you prevent printing, prevent editing, prevent even opening without a password or you can really go all out and use a certificate for your encryption. Yet they have no options to prevent saving at any point, anywhere. Instead offering the consolation of telling you “Don’t worry: The copy they download without your permission will also have the same DRM on it as well”. Unfortunately that was not the sole purpose of the purchase and half a solution is no “solution” at all. There are probably 100 programs that are actually sold just to remove the DRM from Adobe documents and even if not, the point was that the client specified that no downloads be allowed even by users who had access to the private site. Therefore the need to prevent the download to start with is not so hard to understand. While conversion to FLASH may give you the download protection, you lose all the rest. Unless I can find a way to prevent opening, saving etc for a Flash File. Next, is it possible to password protect a Flash file from opening when clicked on?

The “partial fix” that I was finally able to get to work as needed still only disables all the “right click” functions but it does include a nice “Warning Box” where I can explain that the User has already agreed NOT to download, print, save and so on just to have access to the page. I am not sure if I could post the code here or whether it is acceptable to paste links either but a Google search for "Maximus right click" will take you to it. And it was one of several examples, it just happened to be the one I could implement the easiest and worked better than the others. Credit where credit is due.

Another option I was given by someone was a product called “Flipping Book”. And the user above suggestions for “Atalasoft” ( I had already found that and have sent a request for more information). Hopefully it will be “The Solution” and I can implement it in time to help. It seems to me that this is a place where there is an obvious need for a one-step packaged solution and usually "The Laws of Nature" take care of such an Imbalance in short order. Yet my research has taken me through many years of posters all asking for the same thing. Looks like someone would be able to make a nice living off a “simple” way to add a little more "protection" to “PDFs” (or other documents, images etc) for the people who obviously are in need of it. If I find it, and it works, I'm buying it. :>)

I wish I had skills as a programmer because I have some pretty good ideas of ways to implement such a product, unfortunately, I do not know how to put these ideas into practical use.