SetObjectJSON

Object model, document editing

Description

Validates one typed JSON value and replaces the selected existing indirect object while preserving its object and generation numbers. Dictionaries, arrays, streams, scalar values, and references retain their PDF types. Parsing and cloning complete before the object is changed, so malformed input leaves the original object intact

Syntax

Delphi

Function TPDFlib.SetObjectJSON(ObjectNumber: Integer; Const JSON: AnsiString; Options: Integer): Integer;

ActiveX

Function PDFlib::SetObjectJSON(ObjectNumber As Long, JSON As String, Options As Long) As Long

DLL

int DLSetObjectJSON(int InstanceID, int ObjectNumber, const char* JSON, int Options);

Parameters

ObjectNumberExisting indirect object number to replace
JSONTyped value returned by GetObjectJSON or extracted from an object graph
OptionsMust be 0

Return values

1The object was replaced
0The object or JSON is invalid; LastErrorCode is 105