property Keywords: WString; // read only
Keywords 返回文档信息
字典(PDF 1.7 规范第 14.3.3 节)中的 /Keywords 条目。该值是由创作工具编写的
自由格式文本字符串,通常是逗号或分号分隔的
标签列表 — 例如 "invoice; 2024; payable; vendor-acme"
PDF 未指定分隔符,因此应用程序必须接受生成器编写的任何格式
(逗号、分号、换行或空格分隔)
返回值是解码后的 UTF-16;CJK 和其他非 ASCII 关键词可以
正确往返。当 Active 为 False、
Info 字典缺失或未赋值 /Keywords 时,字符串为空。许多
现代创作工具还会将关键词镜像到 XMP 元数据中的
pdf:Keywords 或 dc:subject(RDF 字面量的 Bag)下;当两者
都存在时它们应一致,但在编辑后可能漂移
关键词由桌面搜索索引器(Windows Explorer、Spotlight、
Adobe Bridge)和大多数文档管理系统展示。PDFium Delphi Component 仅暴露
Info 字典的副本 — 通过 PDFium 的
通用元数据访问器访问 MetaText['Keywords'] 以获得相同值
var Tags: TStringList;
Tags := TStringList.Create;
try
Tags.Delimiter := ';';
Tags.StrictDelimiter := True;
Tags.DelimitedText := Pdf1.Keywords;
ListBox1.Items.Assign(Tags);
finally
Tags.Free;
end;