PDFiumVCL Docs

ObjectTransparent property

Bu API girdisi tanımlayıcıları, imzaları, kod bloklarını ve PDF terimlerini özgün biçiminde korur.
Component: TPdf  ·  Unit: PDFium
Indicates whether a page object participates in PDF transparency — either through a non-opaque fill/stroke alpha or through a non-Normal blend mode — and therefore needs compositing rather than simple painter's-algorithm rendering.

Syntax

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

Description

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.

Parameters

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

Remarks

Example

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

See Also

ObjectCount, ObjectType, ObjectBounds, Transparent