PDFium Component Docs

ObjectTransparent 속성

이 API 항목은 식별자, 시그니처, 코드 블록, PDF 용어를 원래 형태로 유지합니다.
컴포넌트: TPdf  ·  유닛: PDFium
page object가 PDF transparency에 참여하는지 나타냅니다 — 불투명하지 않은 fill/stroke alpha나 non-Normal blend mode를 사용하면 simple painter's-algorithm rendering 대신 compositing이 필요합니다

구문

property ObjectTransparent[Index: Integer]: Boolean; // read only

설명

PDF 1.4 introduced the Transparency Imaging Model (PDF 32000-1 § 11), which lets any page object specify a graphics-state alpha (ca/CA) and a blend mode (BM in the ExtGState dictionary). ObjectTransparent returns True if PDFium detected either of these on the object at Index, meaning the renderer cannot simply overpaint and must allocate an isolated compositing buffer for the object.

이것은 전체 current page에 transparent content가 있는지 보고하는 Transparent의 object별 대응입니다. page의 비용이 큰 부분만 flatten하거나, transparency를 이해하지 못하는 print-shop pipeline용으로 들어오는 PDF를 점검하거나, 대부분의 object가 완전히 opaque일 때 compositing을 건너뛰어 custom rendering을 빠르게 하고 싶을 때 사용하세요

결과는 insertion 시점의 object 자체 graphics state를 반영합니다. object를 삽입한 뒤 state를 바꾸면 ObjectTransparent와 실제 appearance가 어긋날 수 있습니다

object (for example through native FPDFPageObj_SetFillColor with a non-255 alpha) only changes the reported value after UpdatePage and ReloadPage have rebuilt the cached page.

매개변수

IndexZero-based page-object index, 0 ≤ Index < ObjectCount.

비고

예제

// Count opaque vs transparent objects on the current page.
var I, NOpaque, NAlpha: Integer;
begin
  NOpaque := 0; NAlpha := 0;
  for I := 0 to Pdf1.ObjectCount - 1 do
    if Pdf1.ObjectTransparent[I] then Inc(NAlpha)
    else Inc(NOpaque);
  Memo1.Lines.Add(Format('opaque=%d, transparent=%d', [NOpaque, NAlpha]));
end;

참고 항목

ObjectCount, ObjectType, ObjectBounds, Transparent