PDFium Delphi Component Docs

AttachmentHasKey 方法

组件: TPdf  ·  单元: PDFium
测试嵌入附件是否携带给定的文件规范键

语法

function AttachmentHasKey(Index: Integer; const Key: WString): Boolean;

IndexInteger。文档级附件的从零开始的索引,低于 AttachmentCount
KeyWString。文件规范字典条目的名称,以 PDF 名称写入
ResultBoolean。当附件携带该键时为 True

说明

嵌入文件的文件规范字典(ISO 32000-1 7.11.3)保存标准条目以及生产者添加的任何私有条目。此方法在不读取值的情况下探测某个键是否存在,这就是调用者区分"不存在"与"存在但为空"的方式

附件列表之外的索引,或不具备该能力的 PDFium 构建,会返回 False 而不是引发异常

用 GetAttachmentStringValue 和 SetAttachmentStringValue 读取和写入值

参见

GetAttachmentStringValue, SetAttachmentStringValue, AttachmentName, AttachmentDescription