Документация PDFiumVCL

FontIsEmbedded property

Эта запись API сохраняет идентификаторы, сигнатуры, блоки кода и термины PDF в исходном виде.
Component: TPdf  ·  Unit: PDFium
Indicates whether the font used by a page object is embedded inside the PDF (True) or merely referenced and resolved at view time from the operating system (False).

Syntax

property FontIsEmbedded[Index: Integer]: Boolean; // read only

Description

FontIsEmbedded reports whether the font referenced by the text page object at the given index carries its actual glyph program inside the PDF file. An embedded font travels with the document and renders identically on any platform; a non-embedded (referenced-only) font relies on the viewer finding a font of the same name installed locally, and may be substituted on display.

The indexer is the 0-based page-object index (0..ObjectCount - 1). Non-text objects always return False. A page must be active before reading the property.

Embedding can be full (every glyph from the source font is present) or subset (only the glyphs actually used appear, with a six-letter prefix added to the base name); both forms count as embedded here. For PDF/A compliance every font must be embedded — this property is a quick auditing tool for that requirement.

Parameters

Index0-based page-object index in the range 0..ObjectCount - 1.

Remarks

Example

var
  I, EmbeddedCount, TextCount: Integer;
begin
  Pdf1.PageNumber := 1;
  EmbeddedCount := 0;
  TextCount := 0;
  for I := 0 to Pdf1.ObjectCount - 1 do
  if Pdf1.ObjectType[I] = otText then
  begin
    Inc(TextCount);
    if Pdf1.FontIsEmbedded[I] then Inc(EmbeddedCount);
  end;
  ShowMessage(Format('%d of %d text objects use embedded fonts',
    [EmbeddedCount, TextCount]));
end;

See Also

FontData, FontFamilyName, FontBaseName, FontHandle, ObjectType