PDFium Delphi Component Docs

ObjectType 속성

컴포넌트: TPdf  ·  유닛: PDFium
지정한 index의 page object 범주를 반환합니다 — text, path, image, shading, 또는 form XObject입니다. 이 분류는 object를 만든 PDF content-stream operator와 일치하며, 호출자는 하나의 switch dispatch로 page-object 배열을 순회할 수 있습니다

Syntax

property ObjectType[Index: Integer]: TObjectType; // read only

Index0 기반 페이지 객체 인덱스로, 0부터 ObjectCount - 1까지의 범위입니다

Description

ObjectType는 Index 위치 페이지 객체의 종류를 알려 주는 TObjectType 열거값을 반환합니다

분류는 안정적이고 값쌉니다. ObjectCount를 도는 타이트한 루프에서 호출하는 것이, 더 비싼 접근자(ObjectBitmap, ObjectBounds, 문자 프로퍼티)를 무엇으로 부를지 정하기 전에 페이지 콘텐츠를 분류하는 표준 방법입니다

폼 XObject는 이 프로퍼티가 재귀적으로 펼치지 않습니다 — 타입은 otForm을 보고하며, 리프 수준 콘텐츠가 필요하면 호출자가 폼 자신의 객체 목록으로 내려가야 합니다

Remarks

Example

// Histogram of object types on the current page
var
  I: Integer;
  Counts: array[TObjectType] of Integer;
  T: TObjectType;
begin
  FillChar(Counts, SizeOf(Counts), 0);
  for I := 0 to Pdf.ObjectCount - 1 do
    Inc(Counts[Pdf.ObjectType[I]]);
  for T := Low(TObjectType) to High(TObjectType) do
    Memo1.Lines.Add(Format('%s: %d', [GetEnumName(TypeInfo(TObjectType), Ord(T)), Counts[T]]));
end;

See Also

ObjectCount, ObjectBounds, ObjectBitmap, RemoveObject