Forum How do I...?

Did I find a PDF Security Bug?

silverRocket
Hi there

I'm trying to create a PDF document that can be opened and printed, but cannot be modified or copied. This cannot be done using passwords (via PHP at least)!

This command...

$prince->setEncryptInfo(128,'','',$disallowPrint=false, $disallowModify=true,$disallowCopy=true, $disallowAnnotate=false);

... results in a document that shows as being "secured" in Acrobat, but if I choose File/Properties/Security and change the Security Method from "Password Security" to "No Security", I can do it and then go about changing and copying the contents of the PDF.

Presumably this is because the 'username' and 'password' from setEncryptInfo are left blank...

... but if I put in a username and password, the resulting PDF *cannot be opened at all* without the username/password being supplied.

Am I doing something wrong? If not, can this be fixed somewhat ASAP?

Thanks!!
mikeday
Try specifying an owner password, but leaving the user password blank. This should allow anyone to open it, but not to change settings unless they provide the owner password.
silverRocket
Yep...

$prince->setEncryptInfo(128,'','bigbadpassword',$disallowPrint=false, $disallowModify=true,$disallowCopy=true, $disallowAnnotate=false);

... does what I'm looking for. Thanks!