function DetachFormObjectChild(FormIndex, ChildIndex: Integer): FPDF_PAGEOBJECT;
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
FormObjectChildren to enumerate the valid child indexes firstChild := Pdf1.DetachFormObjectChild(FormIdx, ChildIdx);
if Child<> nil then
Pdf1.InsertFormObjectFromXObject(1, Child);