PDFiumVCL Docs

Title property

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
Component: TPdf  ·  Unit: PDFium
Returns the value of the /Title entry from the PDF document information dictionary.

Syntax

property Title: WString; // read only

Description

Title returns the document's declared title — the same string that Acrobat shows in the application title bar when the "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 /Title entry of the document information dictionary (ISO 32000-1 § 14.3.3).

If the entry is missing or the component is inactive, the property returns an empty WString. The title is intentionally distinct from the file's basename: a freshly authored PDF saved as quarterly-2026.pdf may legitimately advertise itself as "Q1 2026 Financial Review" via the /Title entry.

The property is read-only. Setting a title at creation time is done through PDFium's FPDF_SetMetaText using the Document handle, or by writing an XMP metadata stream (dc:title).

Remarks

Example

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));

See Also

Author, Subject, Keywords, MetaText, CreationDate, Active