CompareTextBaselineBatch

Small Business, comparison reports

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 an empty string and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

Requires Small Business or Enterprise

Description

Compares up to 64 selected-document and baseline file pairs from one JSON request and returns a batch envelope holding each job's raw text comparison or error

Syntax

Delphi

Function TPDFlib.CompareTextBaselineBatch(Const RequestJSON: WideString): WideString; Virtual;

ActiveX

Function PDFlib::CompareTextBaselineBatch(RequestJSON As String) As String

DLL

const wchar_t* DLCompareTextBaselineBatch(int InstanceID, const wchar_t* RequestJSON);
const char* DLCompareTextBaselineBatchA(int InstanceID, const char* RequestJSON);

Parameters

RequestJSONJSON object whose jobs array holds 1 through 64 entries; each entry names current and baseline files, optional currentPassword and baselinePassword, and an optional integer granularity of 0 for words or 1 for lines, defaulting to 0

Return values

Returns a JSON envelope with status, complete, failedJobs, incompleteJobs and indexed jobs. A valid batch keeps status:"ok" even when individual jobs fail; invalid request schemas return status:"error" with error 905, and the Single edition returns an empty string with error 901.

The request contains a jobs array of 1 through 64 objects; each specifies current and baseline file names, optional currentPassword and baselinePassword strings, and optional integer granularity of 0 or 1, defaulting to 0

{"jobs":[{"current":"revised.pdf","baseline":"approved.pdf","granularity":1}]}

Each pair is loaded into temporary instances; the caller's selected document is retained; failures are recorded per job and do not prevent later jobs from running

The JSON result includes status, complete, failedJobs, incompleteJobs and indexed jobs containing each raw text comparison or error

A valid batch envelope has status:"ok" even when individual jobs fail; inspect the counters and rows; invalid request schemas return status:"error" with error 905

Unknown members, duplicate keys, invalid types, malformed UTF-16 and excessive JSON work are rejected; comparison output is bounded to 16,777,216 UTF-16 code units plus the small batch envelope

DLL and Dylib provide DLCompareTextBaselineBatch and its A variant; ActiveX exposes the method through IPDFlibrary8

CreateTextComparisonReport ยท SaveTextComparisonPDF