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.
This is the per-object analogue of Transparent, which reports whether the whole current page contains any transparent content. Use it when you want to flatten only the costly portions of a page, audit incoming PDFs for print-shop pipelines that do not understand transparency, or speed up custom rendering by short-circuiting compositing for the majority of objects that are fully opaque.
The result reflects the object's own graphics state at insertion time. Mutating the
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.
| Index | Zero-based page-object index, 0 ≤ Index < ObjectCount. |
True.False — the property describes the object itself, not how it is composited with siblings.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;