PDFium Component Docs

ObjectType 속성

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
컴포넌트: TPdf  ·  유닛: PDFium
지정한 index의 page object 범주를 반환합니다 — text, path, image, shading, 또는 form XObject입니다. 이 분류는 object를 만든 PDF content-stream operator와 일치하며, 호출자는 하나의 switch dispatch로 page-object 배열을 순회할 수 있습니다

구문

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

IndexZero-based page-object index, in the range 0 to ObjectCount - 1.

설명

ObjectTypeIndex의 page object 종류를 설명하는 TObjectType enumeration 값을 반환합니다

이 분류는 안정적이고 비용이 적습니다. ObjectCount 전체를 순회하는 tight loop 안에서 호출하는 것이 page content를 분류한 뒤 더 무거운 accessor(ObjectBitmap, ObjectBounds, character property)를 고를 때의 표준 방식입니다

Form XObject는 이 property로 재귀적으로 펼쳐지지 않습니다. type은 otForm을 보고하고, leaf-level content가 필요하면 호출자가 form의 자체 object list로 내려가야 합니다

비고

예제

// 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;

참고 항목

ObjectCount, ObjectBounds, ObjectBitmap, RemoveObject