SetPageElementMarkedContentPropertySource
Content stream editing, Tagged PDF
Description
Parses and sets one complete PDF object as a property on an exact marked-content frame captured by page-element enumeration
Syntax
Delphi
Function TPDFlib.SetPageElementMarkedContentPropertySource(ElementID, MarkedContentIndex: Integer; Const PropertyName, PropertyValueSource: WideString): Integer;Parameters
| ElementID | Opaque page-element handle |
|---|---|
| MarkedContentIndex | 1-based frame index in outer-to-inner order |
| PropertyName | PDF property name with or without a leading slash |
| PropertyValueSource | Exactly one serialized PDF object such as a name, number, string, array, dictionary or indirect reference |
Return values
| 1 | The property was set and all page-element snapshot handles were invalidated |
|---|---|
| 0 | The source is malformed or incomplete, the handle or frame is invalid, the snapshot is stale or a named property resource cannot be resolved |
Remarks
The entire source must decode as one object; trailing tokens are rejected
An inline property dictionary cannot legally contain an indirect reference, so a value that contains one automatically promotes the frame to a page-local named /Properties resource
Existing named property lists are edited by copy-on-write so other occurrences and inherited-resource users remain unchanged
On failure, inspect LastErrorCode: 529 means invalid input, 530 means stale content and 531 means an unresolved named property resource