/Author entry from the PDF document information dictionary.property Author: WString; // read only
Author returns the human-readable name of the person or organization
that authored the original document. Internally the property is a thin
wrapper around MetaText['Author'],
which in turn calls PDFium's FPDF_GetMetaText to read the
/Author string from the document's information dictionary
(the dictionary referenced by the trailer's /Info key
— see ISO 32000-1, section 14.3.3 "Document Information Dictionary").
If the document does not declare an author, or if the document is not
currently loaded, the result is an empty WString. The
property never raises — an empty string is the correct sentinel for
"no author recorded". Because the underlying PDFium API decodes the raw
PDFDocEncoding or UTF-16BE byte string into
UTF-16 for you, the result is always returned in the native Delphi
WideString encoding and is safe to assign directly to a
TStrings, TLabel, or any other Unicode-aware
surface.
The property is read-only. To set the author on a newly created or
loaded document, use the lower-level FPDF_SetMetaText import
against the Document handle, or
author/refresh an XMP packet through the metadata stream.
True (a document must be loaded). Reading it on an inactive
component simply returns an empty string — no exception is raised
for a missing entry.FE FF). PDFium decodes both
forms; you never have to deal with the encoding directly.Author is empty but you can see an author in Acrobat's
properties dialog, look for the value in the XMP packet
(dc:creator).
procedure TForm1.ShowDocumentInfo;
begin
Pdf1.FileName := 'C:\Docs\Report.pdf';
Pdf1.Active := True;
try
Memo1.Lines.Add('Title: ' + Pdf1.Title);
Memo1.Lines.Add('Author: ' + Pdf1.Author);
Memo1.Lines.Add('Subject: ' + Pdf1.Subject);
if Pdf1.Author = '' then
Memo1.Lines.Add(' (no /Author entry in info dictionary)');
finally
Pdf1.Active := False;
end;
end;