PDFiumVCL 文档

Keywords property

此 API 条目保留标识符、签名、代码块和 PDF 术语的原始形式。
Component: TPdf  ·  Unit: PDFium
Author-supplied keyword list from the document Info dictionary.

Syntax

property Keywords: WString; // read only

Description

Keywords returns the /Keywords entry from the document Information dictionary (PDF 1.7 spec section 14.3.3). The value is a free-form text string written by the authoring tool and is conventionally a comma- or semicolon-separated list of tags — e.g. "invoice; 2024; payable; vendor-acme". PDF leaves the delimiter unspecified, so applications must accept whatever format the producer wrote (comma, semicolon, line break, or space-separated).

The return value is decoded UTF-16; CJK and other non-ASCII keywords round-trip correctly. The string is empty when Active is False, when the Info dictionary is missing, or when no /Keywords was assigned. Many modern authoring tools also mirror keywords into XMP metadata under pdf:Keywords or dc:subject (a Bag of RDF literals); when both are present they should agree but may diverge after edits.

Keywords are surfaced by desktop search indexers (Windows Explorer, Spotlight, Adobe Bridge) and by most document-management systems. PDFiumVCL exposes the Info-dictionary copy only — access MetaText['Keywords'] for the same value through PDFium’s generic metadata accessor.

Remarks

Example

var Tags: TStringList;
Tags := TStringList.Create;
try
  Tags.Delimiter := ';';
  Tags.StrictDelimiter := True;
  Tags.DelimitedText := Pdf1.Keywords;
  ListBox1.Items.Assign(Tags);
finally
  Tags.Free;
end;

See Also

Subject, Title, Author, MetaText