Docs PDFiumVCL

Subject property

Esta entrada API preserva identificadores, assinaturas, blocos de código e termos PDF em sua forma original.
Component: TPdf  ·  Unit: PDFium
Returns the value of the /Subject entry from the PDF document information dictionary.

Syntax

property Subject: WString; // read only

Description

Subject returns the document's /Subject info-dictionary entry — a short, free-form description of what the document is about. The property delegates to MetaText['Subject'], which invokes PDFium's FPDF_GetMetaText for that key. The field is defined in ISO 32000-1 § 14.3.3 alongside /Title, /Author, and /Keywords.

When the document has no /Subject entry, when it is not yet loaded, or when the trailer's /Info reference is missing altogether, the property returns an empty WString. No exception is raised.

Conceptually /Subject answers "what is this document?" while /Title answers "what is this document named?". In practice many producers leave Subject blank, so treat it as optional supplementary text rather than a required field.

Remarks

Example

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;

See Also

Title, Author, Keywords, Creator, MetaText