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

ElementIDOpaque page-element handle
MarkedContentIndex1-based frame index in outer-to-inner order
PropertyNamePDF property name with or without a leading slash
PropertyValueSourceExactly one serialized PDF object such as a name, number, string, array, dictionary or indirect reference

Return values

1The property was set and all page-element snapshot handles were invalidated
0The 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