PDFium Delphi Component Docs

ObjectCount プロパティ

コンポーネント: TPdf  ·  ユニット: PDFium
現在ページにある page object (text、path、image、shading、form) の読み取り専用件数です

構文

property ObjectCount: Integer; // read only

説明

開いている PDF ドキュメントに関連付けられた page object(text、path、image、shading、form)の数を返します。PageNumber を別のページへ割り当てたときや、ページオブジェクトを挿入・削除する変更呼び出しの後で、この数は変わります

値は基底の PDFium エンジンから直接読まれます(Active が True で現在ページがロードされている必要があります)。ドキュメントが閉じている、問い合わせたスコープに page object(text、path、image、shading、form)がない、現在の PDF にこのプロパティが適用されない、のいずれかでは結果は 0 です

値はアクティブなページから FPDFPage_CountObjects で問い合わせます

備考

例

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;

関連項目

ObjectHandle, ObjectBounds, ObjectTransparent