IsEncrypted

安全与签名

描述

报告所选文档是否已加密。已加载文档的 trailer 中带有 /Encrypt 字典时返回 1;文档以明文存储或未加载任何文档时返回 0

编辑之前可先用本标志分支:加密文件必须先通过 CheckPassword 验证或用 Decrypt 解密,才能修改内容并重新保存

语法

Delphi

Function TPDFlib.IsEncrypted: Integer;

返回值

0所选文档未加密,或未加载任何文档
1所选文档带有 /Encrypt 字典

备注

该标志精确反映文档加载时的状态;可搭配 GetEncryptionLevel 查看密码强度,搭配 GetUserPermissions 查看原始 /P 权限字

另请参阅

GetEncryptionLevel、GetUserPermissions、IsOwnerPassword、CheckPassword、Decrypt、SecurityInfo