MergeWorkflowJSON
Workflow data tools, ActiveX, DLL
Description
Applies a JSON Merge Patch to a source document and returns the merged document
Syntax
ActiveX
Function PDFlib::MergeWorkflowJSON(SourceJSON As String, PatchJSON As String, Indent As Long, SortNames As Long) As StringDLL
const wchar_t* DLMergeWorkflowJSON(int InstanceID, const wchar_t* SourceJSON, const wchar_t* PatchJSON, int Indent, int SortNames);
const char* DLMergeWorkflowJSONA(int InstanceID, const char* SourceJSON, const char* PatchJSON, int Indent, int SortNames);
Parameters
| InstanceID | Library instance returned by DLCreateLibrary |
|---|---|
| SourceJSON | Document to merge into |
| PatchJSON | Merge Patch document |
| Indent | -1 writes compact JSON in the original member order; 0 through 16 writes formatted JSON with that many spaces per level and LF line breaks |
| SortNames | Nonzero sorts object member names by UTF-16 code unit in formatted output; ignored when Indent is -1 |
Return values
Returns a borrowed string that stays valid until a later call on the same instance; copy it at once, using DLStringResultLength for the wide function or DLAnsiStringResultLength for the ANSI function. A successful empty result is a valid empty string. Nil means the input was rejected; call GetWorkflowToolsError for the reason
Remarks
Objects merge recursively, a null patch member deletes the matching source member, and every other value, including an array, replaces the source value
Neither input is modified; parse errors and excessive work return Nil with the reason
The ANSI function converts text using the instance's SetAnsiMode setting; use UTF-8 mode for non-ASCII data
ActiveX exposes this method on IPDFlibrary24; obtain it with CoPDFlibrary.CreateEditionTools24 or query the default interface of PDFlibAX 4.74 or later
All editions include these functions. Failed ActiveX calls return an empty string, 0 or Empty and record the reason for GetWorkflowToolsError. The C#, VB.NET and Visual C++ WorkflowTools examples in the DLL and ActiveX demo folders show a complete request, page plan and rollback workflow
See also
Workflow data tools · Virtual file registry · GetWorkflowToolsError