procedure SetText(ObjectIndex: Integer; const Text: WString);
Swaps the text content of the text page object at ObjectIndex (0 .. ObjectCount - 1) on the current page
To put a brand-new text object onto the page, call AddText instead
All edits to the current page are buffered in PDFium's in-memory representation. Call UpdatePage to refresh the rendering cache and SaveAs to persist the changes
ObjectIndex must point at a text object (ObjectType[ObjectIndex] = otText)UpdatePage after editing text objects so the page content stream is regenerated
begin
if Pdf1.Active and (Pdf1.ObjectCount > 0) and (Pdf1.ObjectType[0] = otText) then
begin
Pdf1.SetText(0, 'Updated text');
Pdf1.UpdatePage;
end;
end;
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