PDFium Delphi Component Docs

DetachFormObjectChild method

Component: TPdf  ·  Unit: PDFium
Transfers one child out of a form object and returns ownership to the caller

Syntax

function DetachFormObjectChild(FormIndex, ChildIndex: Integer): FPDF_PAGEOBJECT;

Description

DetachFormObjectChild removes the child at ChildIndex from the form object at FormIndex and returns its native page-object handle

The caller owns the returned handle until it is inserted into another container with InsertFormObjectFromXObject or destroyed; the returned handle is nil when either index is out of range

Remarks

    • The detached child is no longer reachable from its previous parent, so export or save operations skip it until it has been re-inserted
    • Pair this with FormObjectChildren to enumerate the valid child indexes first

Example

Child := Pdf1.DetachFormObjectChild(FormIdx, ChildIdx);
if Child<> nil then
  Pdf1.InsertFormObjectFromXObject(1, Child);

See Also