How to Protect the PDF file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mattarambabu
Forum Newbie
Posts: 1
Joined: Wed Mar 28, 2007 1:06 am

How to Protect the PDF file?

Post by mattarambabu »

I have created a PDF file using PHP code. I want to protect restrict the useres from saving the file to the disk ,printing , selecting. i.e users can only read the pdf document.

Any body plz help me, if you have worked on this.
Thanks in advance

Rams
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Place the PDF above the document root. I'm not sure if this will keep people from saving it.. because i'm not all too familiar with pdfs.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
ryuuka
Forum Contributor
Posts: 128
Joined: Tue Sep 05, 2006 8:18 am
Location: the netherlands

Post by ryuuka »

why not just use javascript to disallow people to use the right click function?

http://www.reconn.us/content/view/36/45/

http://www.codebeach.com/tutorials/disa ... script.asp
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Re: How to Protect the PDF file?

Post by stereofrog »

mattarambabu wrote:I have created a PDF file using PHP code. I want to protect restrict the useres from saving the file to the disk ,printing , selecting. i.e users can only read the pdf document.
You can't. "Read" in technical sense is the same as "save".
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Saving: Absolutely cannot be done. If the user is viewing the PDF, they've already downloaded it (although they may not know it).
Printing: Again, impossible to stop people from printing the contents of a PDF. They can always take screenshots & print those screenshots. Depending on which library you used to create the PDFs, you can set permissions in the PDF which will disallow them from printing the PDF directly from Acrobat. However, if they're using a non-Adobe reader (I don't know if they're very common - but they exist), there's a chance those permissions will be ignored.
Selecting & copying content: Depending on your library, permissions can be set to disallow this. Again though, if they're using a reader that doesn't acknowledge permissions, they can get around that.

Basically, if you're passing information to the users monitor via the web, there is nothing you can do to stop the user from holding on to it permanently.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply