property ObjectCount: Integer; // read only
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
0 when Active is False or when the relevant PDF dictionary entry is missing0 .. ObjectCount - 1 as the valid range when reading ObjectHandle[Index]. Out-of-range indices raise EPdfError
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;