Add

Native Pascal, workflow preparation, Content streams

Description

Two members share this name: TPLWorkflowJSON.Add appends a child node to a workflow JSON container, and TPDFContentFilterChain.Add registers a content filter callback; both are documented below.

Appends Value as the last child of an array or object node and transfers ownership to it: the parent frees the child together with itself, so after a successful call the caller must not free the child separately.

Name is recorded as the member name and must be unique within an object; the parser passes an empty name for array elements.

Registers one filter callback at the end of a TPDFContentFilterChain. Filters run in registration order when Apply is called, so add callbacks in the sequence they must execute.

FilterData is a caller-defined pointer passed back to that callback unchanged on every invocation, typically a context record or per-filter configuration.

Syntax

Delphi

Procedure TPLWorkflowJSON.Add(Const Name: WideString; Value: TPLWorkflowJSON);
Procedure TPDFContentFilterChain.Add(Callback: TPDFContentFilterCallback; FilterData: Pointer = Nil);

Parameters

NameMember name stored with the child; must not duplicate an existing member name when the parent is an object
ValueChild node to append; must not be Nil, must not already be owned by another container, and must not create an ownership cycle
CallbackFilter callback to register; it receives one parsed TPDFContentProgram per content layer and may mutate the instruction list directly
FilterDataOpaque pointer passed through to the callback unchanged; Nil by default

Remarks

The call raises an exception when this node is neither wjArray nor wjObject, when an object already has a member with that name, or when the child fails the ownership checks above, including trees deeper than 256 levels.

Passing Nil for Callback is ignored: nothing is appended and the chain is unchanged.

See also

WorkflowDataTools, ProbeWorkflowRequest, TPDFContentFilterChain, NewContentFilterChain, ApplyContentFilterChain, ApplyContentFilterChainExt, TPDFContentProgram, Apply