PDFium Delphi Component Docs

ObjectCount property

Component: TPdf  ·  Unit: PDFium
Read-only count of the page objects (text, path, image, shading, form) on the current page

Syntax

property ObjectCount: Integer; // read only

Description

Returns the number of page objects (text, path, image, shading, form) associated with the open PDF document. The count changes when PageNumber is assigned to a different page, or after mutating calls that insert or remove page objects

The value is read directly from the underlying PDFium engine (requires Active to be True and a current page to be loaded). When the document is closed, has no page objects (text, path, image, shading, form) at the queried scope, or the property is not applicable for the current PDF, the result is 0

The value is queried from the active page via FPDFPage_CountObjects

Remarks

Example

var
  I: Integer;
begin
  if not Pdf1.Active then Exit;
  Memo1.Lines.Add(Format('%d page objects (text, path, image, shading, form)', [Pdf1.ObjectCount]));
  for I := 0 to Pdf1.ObjectCount - 1 do
  begin
    // inspect each item
    Memo1.Lines.Add(Format(' [%d]', [I]));
  end;
end;

See Also

ObjectHandle, ObjectBounds, ObjectTransparent