FormatWorkflowJSON

Workflow data tools, ActiveX, DLL

Description

Parses a JSON document with the bounded workflow parser and returns it compact or formatted

Syntax

ActiveX

Function PDFlib::FormatWorkflowJSON(JSON As String, Indent As Long, SortNames As Long) As String

DLL

const wchar_t* DLFormatWorkflowJSON(int InstanceID, const wchar_t* JSON, int Indent, int SortNames);
const char* DLFormatWorkflowJSONA(int InstanceID, const char* JSON, int Indent, int SortNames);

Parameters

InstanceIDLibrary instance returned by DLCreateLibrary
JSONJSON text to validate and format
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
SortNamesNonzero 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

The parser rejects duplicate member names, invalid UTF-16 and inputs above 32 Mi UTF-16 code units, depth 64, 250,000 nodes or 10,000 children per container

Number spellings are preserved, so 64-bit identifiers and exact decimals keep their original text

Formatted output with sorted names is stable for repeatable request files; it is not a cryptographic canonicalization format

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