procedure InsertObjectAtIndex(StackIndex: Integer; PageObj: Pointer);
| StackIndex | Integer. Zero-based position in the content stream where the object is placed. Objects at or after this position move up by one |
| PageObj | Pointer. Handle of a page object created but not yet inserted, such as the handle returned by ObjectHandle for an object detached with RemoveObject |
Page objects paint in content-stream order, so the last object drawn wins where objects overlap. Appending always puts new content on top; this method places it at any depth, which is what a caller needs to slide a watermark underneath existing text or to restack an object that was removed and re-added
The page takes ownership of the object, also when the call raises an exception, for an out-of-range index for example; do not destroy the object afterwards. Passing nil is ignored, as is a call on a PDFium build that does not export the underlying entry point, so the method is safe to call unconditionally
The cached text page is dropped and the page is marked as modified. Call UpdatePage before saving so the edited content stream is regenerated
Since internal v3.403.0, direct logical text, object membership and ActualText changes clear the affected saved paragraph cluster tables Geometry, style and metadata-only changes retain the tables and regenerate complete represented shared mark scopes across adjacent nonempty streams Mark list membership is local to the selected object, whilst exact shared declarations keep their identity The bundled DLLs isolate named-property parameter edits; native builds without detachment reject a table-affecting logical change before mutation
Read the native character maps again after mutation or reload These low-level operations do not supply reviewed replacement semantics or repair arbitrary tagged ownership Use the batch semantic-edit policies when those values and bindings must be reviewed together See scope, ownership and remaining source-preservation limits