GetWorkflowJSONPointer
Workflow data tools, ActiveX, DLL
Description
Selects a value in a JSON document with a JSON Pointer and returns it as JSON or as scalar text
Syntax
ActiveX
Function PDFlib::GetWorkflowJSONPointer(JSON As String, Path As String, Mode As Long) As StringDLL
const wchar_t* DLGetWorkflowJSONPointer(int InstanceID, const wchar_t* JSON, const wchar_t* Path, int Mode);
const char* DLGetWorkflowJSONPointerA(int InstanceID, const char* JSON, const char* Path, int Mode);
Parameters
| InstanceID | Library instance returned by DLCreateLibrary |
|---|---|
| JSON | Document to search |
| Path | JSON Pointer such as /batches/0/pages; an empty path selects the root, ~1 encodes a slash and ~0 a tilde |
| Mode | 0 returns the selected value as compact JSON; 1 returns scalar text: the unescaped string, the number spelling, true, false or null |
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
A missing or malformed path returns Nil; mode 1 also returns Nil for an array or object
Use mode 1 to read fields from the JSON reports returned by AnalyzePageRanges and GetVirtualFilesJSON without a JSON library
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