PDFium Component Docs

Title プロパティ

この API エントリでは識別子、シグネチャ、コードブロック、PDF 用語を元の表記のまま保持します。
コンポーネント: TPdf  ·  ユニット: PDFium
Returns the value of the /Title entry from the PDF document information dictionary.

構文

property Title: WString; // read only

説明

Title は文書で宣言されたタイトルを返します — Acrobat がアプリケーションタイトルバーに表示するものと同じ文字列です。"Display document title in title bar" viewer preference is set The value is fetched via MetaText['Title'], which calls PDFium's FPDF_GetMetaText against the /Titledocument information dictionary のエントリです (ISO 32000-1 § 14.3.3)

エントリが欠落している場合、またはコンポーネントが非アクティブな場合、このプロパティは空のWStringを返します。タイトルは意図的にファイルのベース名とは区別されます。新しく作成された PDF をquarterly-2026.pdf may legitimately advertise itself as "Q1 2026 Financial Review" via the /Title entry.

このプロパティは読み取り専用です。作成時にタイトルを設定するには PDFium のFPDF_SetMetaText using the Document handle, or by writing an XMP metadata stream (dc:title).

備考

function EffectiveTitle(Pdf1: TPdf; const Fallback: string): string;
begin
  if not Pdf1.Active then
    Pdf1.Active := True;
  Result := Trim(Pdf1.Title);
  if Result = '' then
    Result := Fallback;
end;

// Use the document's own title for the form caption.
Caption := EffectiveTitle(Pdf1, ExtractFileName(Pdf1.FileName));

関連項目

Author, Subject, Keywords, MetaText, CreationDate, Active