PDFiumVCL Docs

ObjectHandle property

Denna API-post behåller identifierare, signaturer, kodblock och PDF-termer i ursprunglig form.
Component: TPdf  ·  Unit: PDFium
Raw PDFium FPDF_PAGEOBJECT pointer for the specified page object, intended for direct calls into the native PDFium C API.

Syntax

property ObjectHandle[Index: Integer]: Pointer; // read only

Description

Returns the opaque FPDF_PAGEOBJECT pointer that PDFium uses to identify the page object at position Index on the current page. The same handle that ObjectBounds, ObjectType and the other indexed object properties resolve internally is exposed here so advanced callers can invoke FPDFPageObj_*, FPDFPath_*, FPDFText_*, or FPDFImageObj_* functions that are not yet wrapped by the component.

The handle is owned by the current page and stays valid only while the page is loaded. Calling ReloadPage, switching PageNumber, removing the object with RemoveObject, or setting Active to False invalidates every previously cached ObjectHandle. Never call FPDFPageObj_Destroy on a handle that is already attached to a page — destroying it twice will crash PDFium.

Use ObjectType first to dispatch on the kind of object you are pointing at, then cast and call the appropriate PDFium family of helpers. The pointer can also be compared for identity across calls within a single page session, which is useful when correlating editing operations with their resulting objects.

Parameters

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

Remarks

Example

// Read the blend mode of the first object using the raw PDFium API.
uses PDFiumLib;
var Obj: FPDF_PAGEOBJECT;
var Blend: array[0..15] of AnsiChar;
begin
  Obj := Pdf1.ObjectHandle[0];
  if Assigned(Obj) then
    FPDFPageObj_GetBlendMode(Obj, @Blend[0], SizeOf(Blend));
  ShowMessage(string(Blend));
end;

See Also

ObjectCount, ObjectType, ObjectBounds, UpdatePage, RemoveObject