THotPDF.UserPassword Property
HotPDF Delphi PDF Component Developer Guide loslab Logo

 

THotPDF.UserPassword

THotPDF

 

Top  Previous  Next

Determines document user password.

 

Delphi syntax:

property UserPassword: AnsiString;

 

C++ syntax:

__property AnsiString UserPassword;

 

Description

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.

 

If a user attempts to open an encrypted document that has a user password, the viewer application should prompt for a password. Correctly supplying either password allows the user to open the document, and display it on the screen. If the document does not have a user password, no password is requested;

 

Code Example

HPDF.OwnerPassword := 'password';          // Set owner password (required to change security settings)
HPDF.UserPassword := 'user';               // Set user password (required to open the document)
HPDF.ProtectOptions := [poEdit, poAnnot];  // Disallow editing and annotations
HPDF.ActivateProtection := true;           // Enable PDF security

 

See also: ActivateProtection, CryptKeyLength, OwnerPassword, ProtectOptions

Copyright©2007-2025 losLab.com