THotPDF.OwnerPassword Property

 

THotPDF.OwnerPassword

THotPDF

 

顶部  上一页  下一页

Determines document owner password.

 

Delphi 语法:

property OwnerPassword: AnsiString;

 

C++ 语法:

__property AnsiString OwnerPassword;

 

说明

用正确 owner password 打开文档(假定它不同于 user password)可获得对文档的完整 owner access。该无限制访问包括更改文档 passwords 和 access permissions 的能力

 

使用 AES-256 加密(revision 5 或 6)时,密码按 UTF-8 计,且只使用前 127 字节,这是 ISO 32000-2 的规定。HotPDF 会把 AnsiString 从其代码页(通常是系统代码页)转换过来,因此含非 ASCII 字母的密码在任何合规阅读器中都能打开文件。代码页无法表示的字母,在把 Unicode 字符串赋给这个 AnsiString 属性时会丢失。RC4 和 AES-128 则按给定字节使用密码

 

代码示例

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, ProtectOptions, UserPassword