Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent PDF file from downloading and printing

Tags:

security

pdf

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?

like image 525
Costa Avatar asked Feb 08 '11 08:02

Costa


People also ask

Can a PDF be protected from printing?

For instance, PDF files can be protected by a password and recipients must enter that same password before they can open the file. In other cases, the PDF creator may add print restrictions that disallow other users from printing the document.


1 Answers

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.

like image 117
guildsbounty Avatar answered Sep 20 '22 08:09

guildsbounty