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가 어긋날 수 있습니다
FPDFPageObj_SetFillColor with a non-255
alpha) only changes the reported value after UpdatePage
and ReloadPage have rebuilt the cached page.
| Index | Zero-based page-object index, 0 ≤ Index < ObjectCount. |
True.False를 반환할 수 있습니다 — 이 속성은 객체 자체를 설명할 뿐, 형제와 어떻게 합성되는지는 설명하지 않습니다FPDFPageObj_HasTransparency and is intentionally cheap to call inside loops over 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;