PDFium Delphi Component Docs

Subject 属性

组件: TPdf  ·  单元: PDFium
返回 PDF 文档信息字典中 /Subject 条目的值

语法

property Subject: WString; // read only

说明

Subject 返回文档的 /Subject 信息字典 条目 — 对文档内容的简短自由格式描述。 该属性委托给 MetaText['Subject'],后者 为该键调用 PDFium 的 FPDF_GetMetaText。 该字段在 ISO 32000-1 § 14.3.3 中与 /Title、/Author 和 /Keywords 一起定义

当文档没有 /Subject 条目、尚未 加载或尾部的 /Info 引用完全缺失时, 该属性返回空的 WString。不抛出异常

概念上 /Subject 回答"这个文档是什么?" 而 /Title 回答"这个文档叫什么?"。 实际上许多生成器将 Subject 留空, 因此将其视为可选补充文本而非必填字段

备注

示例

procedure TForm1.DumpMetadataToGrid;
begin
  Pdf1.Active := True;
  StringGrid1.Cells[0, 0] := 'Field';
  StringGrid1.Cells[1, 0] := 'Value';
  StringGrid1.Cells[0, 1] := 'Title';
  StringGrid1.Cells[1, 1] := Pdf1.Title;
  StringGrid1.Cells[0, 2] := 'Subject';
  StringGrid1.Cells[1, 2] := Pdf1.Subject;
  StringGrid1.Cells[0, 3] := 'Author';
  StringGrid1.Cells[1, 3] := Pdf1.Author;
end;

参见

Title, Author, Keywords, Creator, MetaText