THotPDF.UserPassword Property

 

THotPDF.UserPassword

THotPDF

 

先頭  前へ  次へ

Determines document user password.

 

Delphi syntax:

property UserPassword: AnsiString;

 

C++ syntax:

__property AnsiString UserPassword;

 

説明

正しいユーザーパスワードでドキュメントを開く(またはユーザーパスワードのないドキュメントを開く)と、ドキュメントの encryption dictionary で指定されたユーザーアクセス権限に応じて、追加の操作を実行できるようになります

 

user password を持つ encrypted document を user が開こうとした場合、viewer application は password を求める必要があります。どちらかの password を正しく入力すると、user は document を開いて画面に表示できます。document に user password がない場合、password は要求されません

 

AES-256 暗号化(revision 5 または 6)では、パスワードは UTF-8 として扱われ、ISO 32000-2 の定義どおり最初の 127 バイトだけが使われます。HotPDF は AnsiString をコードページ(通常はシステムのもの)から変換するので、非 ASCII 文字を含むパスワードでも、準拠したリーダーならファイルを開けます。コードページで保持できない文字は、Unicode 文字列をこの AnsiString プロパティに代入した時点で失われます。RC4 と AES-128 は、与えられたパスワードのバイトをそのまま使います

 

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 := [prPrint, prInformationCopy]; // Allow printing and copying only
HPDF.ActivateProtection := true;           // Enable PDF security

 

関連項目: ActivateProtection, CryptKeyLength, OwnerPassword, ProtectOptions