function PageObjectInfo(Index: Integer): TPdfPageObjectInfo;
| Index | Integer. Zero-based index of the page object, in content-stream order. Valid values run from 0 to ObjectCount - 1 |
| Result | TPdfPageObjectInfo. A snapshot record holding the object handle, type, bounds, transform matrix, fill and stroke colours, stroke width, line join and cap and dash pattern |
Collects in one record what would otherwise take a dozen separate PDFium calls: the object type, its axis-aligned Bounds, its rotated bounds when the object carries a rotation, the transform Matrix, the fill and stroke colours with their alpha values, the stroke width, the line join and cap styles and the dash array with its phase
Attributes that a given object type does not carry are reported as absent rather than as zero: each optional group has a Has... flag (HasMatrix, HasFillColor, HasStrokeWidth and so on). A text object has no stroke width, so HasStrokeWidth is False and StrokeWidth is meaningless - checking the flag is the only way to tell "no stroke" from "a stroke of width 0"
The record is a snapshot, not a live view. Editing its fields changes nothing in the document; pass the modified record back through UpdatePageObject together with the set of fields that should be written
var Info: TPdfPageObjectInfo;
Info := Pdf.PageObjectInfo(0);
if Info.HasFillColor then
ShowMessage(ColorToString(Info.FillColor));