VpeSetUserPassword

<< Click to Display Table of Contents >>

Navigation:  PDF Export >

VpeSetUserPassword

Previous pageReturn to chapter overviewNext page

[VPE Professional Edition and above]

Sets the user password for the document. In order to be able to open an encrypted document (see VpeSetEncryption()), either this password - or the owner password - must be entered in advance. The document can not be opened, if an incorrect password is supplied (see also VpeSetOwnerPassword()).

If the document does not have a user password, no password is requested; Acrobat Reader can simply open, decrypt, and display the document.

Whether additional operations are allowed on a decrypted document depends on if either the user password or the owner password (if any) was supplied when the document was opened and on any access restrictions that were specified when the document was created.

Opening the document with the correct user password (or opening a document that does not have a user password) allows additional operations to be performed according to the user access permissions specified in the document’s encryption dictionary (see VpeSetProtection()).

void VpeSetUserPassword(

VpeHandle hDoc,

LPCSTR user_password

)

VpeHandle hDoc

Document Handle

LPCSTR user_password

A string which may contain any characters. Up to 32 characters of the password are used for generating the encryption key (see VpeSetEncryptionKeyLength()).

Default:

not set (i.e. empty)