ExecuteVCRDataMergeCurrent

Integration and compatibility

Requires the Small Business edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibSmallBusiness (unit PDFlibSmallBusiness) or TPDFlibEnterprise; the Small Business and Enterprise DLL and ActiveX builds provide it unchanged; the Single edition keeps the method, which returns 0 and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

Description

Merges field values into the selected PDF/VCR template document and loads the result as a new selected document, keeping the original template open

JSON field names and values use standard JSON string escapes, including Unicode escapes; an explicit empty string clears its placeholder, while an absent field leaves its placeholder unchanged

Syntax

Delphi

Function TPDFlib.ExecuteVCRDataMergeCurrent(Const FieldValues: WideString;
  Options: Integer): Integer; Virtual;

ActiveX

Function PDFlib::ExecuteVCRDataMergeCurrent(FieldValues As String, Options As Long) As Long

DLL

int DLExecuteVCRDataMergeCurrent(int InstanceID, const wchar_t* FieldValues, int Options);
int DLExecuteVCRDataMergeCurrentA(int InstanceID, const char* FieldValues, int Options);

DLExecuteVCRDataMerge and DLExecuteVCRDataMergeA are legacy export aliases of the Current pair with identical parameters and behaviour

Parameters

FieldValuesA JSON object or semicolon-delimited name=value list of placeholder values
OptionsMust be 0

Return values

Returns 1 when the merged copy is selected, or 0 on failure; unsupported Options or a template or merge failure report LastErrorCode 608

Remarks

The selected template is saved and validated in memory, merged and loaded only on success; a failure does not select a partial document. The original template remains available through its earlier SelectedDocument handle

The DLL and ActiveX ExecuteVCRDataMerge entry points use this route; see Automation extensions

See also

ExecuteVCRDataMerge, ExecuteVCRDataMergeEx