/BaseFont entry from the PDF font dictionary) of the font used by a page object, including any style suffix such as -Bold or ,Italic.property FontBaseName[Index: Integer]: WString; // read only
FontBaseName returns the PostScript base font name as stored in the PDF font dictionary — this is the value of the /BaseFont key (PDF 1.7 section 9.6 / 9.7). For embedded subset fonts PDFium preserves the six-letter prefix (e.g. ABCDEF+Helvetica-Bold) so that the value remains a faithful copy of what the producer wrote. For a stripped, human-friendly family name use FontFamilyName.
The indexer is the 0-based page-object index (0..ObjectCount - 1). Only text objects produce a non-empty result; non-text objects return an empty string. A page must be active when reading the property.
The base name is the most reliable identifier of the exact face being used, because it bundles family and style into a single token. Two text runs may share FontFamilyName = Helvetica but differ here as Helvetica vs Helvetica-Bold vs Helvetica-Oblique.
| Index | 0-based page-object index in the range 0..ObjectCount - 1. |
ABCDEF+) are part of the value — strip them yourself if you need a clean name.Helvetica, Helvetica-Bold, Times-Roman, Times-Italic, etc.Arial,Bold — not a dash./BaseFont.var
I: Integer;
Base: WString;
begin
Pdf1.PageNumber := 1;
for I := 0 to Pdf1.ObjectCount - 1 do
begin
Base := Pdf1.FontBaseName[I];
if (Base <> '') and (Pos('Bold', Base) > 0) then
Memo1.Lines.Add(Format('Object %d uses %s', [I, Base]));
end;
end;