PDFium Delphi Component Docs

UpdatePageObject method

Component: TPdf  ·  Unit: PDFium
Write back selected attributes of a page object, leaving every attribute outside the change set untouched

Syntax

procedure UpdatePageObject(Index: Integer; const Value: TPdfPageObjectInfo; Changes: TPdfPageObjectChanges);

IndexInteger. Zero-based index of the page object to modify
ValueTPdfPageObjectInfo. Record carrying the new attribute values, normally obtained from PageObjectInfo and then edited
ChangesTPdfPageObjectChanges. Set of TPdfPageObjectChange flags selecting which attributes to write: pocMatrix, pocActive, pocFillColor, pocStrokeColor, pocStrokeWidth, pocLineJoin, pocLineCap, pocDashPattern

Description

Applies the fields named by Changes to the page object at Index. An empty set is a no-op, so a caller can compute a change set and call unconditionally

The change set exists because a TPdfPageObjectInfo record always carries every attribute, including the ones PDFium does not expose for that object type. Writing all of them back would push meaningless values into the object - for example a stroke colour onto an image. Naming the fields explicitly keeps the edit as narrow as the caller intended

Colour changes take the alpha value from the matching field of the record: pocFillColor writes FillColor together with FillAlpha, and pocStrokeColor writes StrokeColor with StrokeAlpha. The cached text page is discarded because a geometry or colour edit can change extracted text positions

Example

var Info: TPdfPageObjectInfo;
Info := Pdf.PageObjectInfo(2);
Info.FillColor := clRed;
Info.FillAlpha := $FF;
Pdf.UpdatePageObject(2, Info, [pocFillColor]);
Pdf.UpdatePage;

Saved paragraph metadata

Since internal v3.403.0, direct logical text, object membership and ActualText changes clear affected saved paragraph cluster tables Geometry, style and metadata-only changes retain tables and regenerate complete represented shared mark scopes across adjacent nonempty streams Mark list membership is local to the selected object, while 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 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

See Also

PageObjectInfo, TransformPageObject, RemoveObject, UpdatePage