I have a document that's encrypted with both user and owner passwords. Regardless of if I open the document with User or Owner password, the Document properties for OwnerPassword, UserPassword, and Permissions are all the same. OwnerPassword and UserPassword both get set to the password I used to open the document.
How can I tell which password the user has entered?
Ben Dilts
Detect if user entered Owner vs. User password?
Let me explain
Let me explain. I created a document with 128-bit encryption. The user password is "user" and the owner password is "owner". Now I close the document. I open it again, and I am prompted for a password. I type in "user". Now, in the PDF control, both the UserPassword and OwnerPassword properties on the document are set to "user".
That is, when a document is opened using a password, both the UserPassword and the OwnerPassword are set to whatever was given by the user when opening the document, NOT what was set when the document was encrypted.
So I need a way to tell what the current user actually has permissions to do on the document.
That is, when a document is opened using a password, both the UserPassword and the OwnerPassword are set to whatever was given by the user when opening the document, NOT what was set when the document was encrypted.
So I need a way to tell what the current user actually has permissions to do on the document.
Re: Detect if user entered Owner vs. User password?
The control can only check if a given password is valid, it cannot read the passwords from the document. For e.g. if the user supplies one of the two passwords, the control can check if it is valid and internally sets a flag to whether the password is the owner or user passowrd, but it cannot read the other password. This is why both attributes are set to the same value.
You can check if the user is allowed to print or modify a document by using the UpdateCommandTool call. You can check the online documentation for this call by visiting: http://www.amyuni.com/WebHelp/Developer ... #index.htm.
If you need more than these 2 basic checks, you can log a feature request on the forum or by emailing us.
Amyuni Development Team
You can check if the user is allowed to print or modify a document by using the UpdateCommandTool call. You can check the online documentation for this call by visiting: http://www.amyuni.com/WebHelp/Developer ... #index.htm.
If you need more than these 2 basic checks, you can log a feature request on the forum or by emailing us.
Amyuni Development Team