GetLastUnicodeReplacementDiagnostics

Extraction, Unicode, content editing

Description

Returns the latest content-stream Unicode replacement result as JSON without clearing LastErrorCode

Syntax

Delphi

Function TPDFlib.GetLastUnicodeReplacementDiagnostics: WideString;

DLL

const wchar_t* DLGetLastUnicodeReplacementDiagnostics(int InstanceID);
const char* DLGetLastUnicodeReplacementDiagnosticsA(int InstanceID);

ActiveX

Function PDFlib::GetLastUnicodeReplacementDiagnostics() As String

Return values

Returns JSON describing the latest content-stream Unicode replacement. When no replacement has run it returns a JSON object with status not-checked.

Result fields

The initial status is not_checked; completed includes replacedHits, error includes a code, and unsupported includes either a code or a message describing the rejected operation

{"status":"completed","replacedHits":2}
{"status":"unsupported","message":"Replacement font mapping is incomplete or unsupported"}

A completed result with replacedHits 0 means no match was found; unsupported means no selected page text was replaced

Matches that span lines go through the same transaction: if a later span or font mapping is unsupported, all of the selected original text is kept and the rejected request is reported

The DLL A getter returns UTF-8; returned DLL string pointers remain valid until the next string-returning call on that instance

SearchAndReflowTextInContent adds engine box-reflow and a boxes array to completed edits; each item reports hit, lines, fontSize, remainingStart, remainingUTF16Units and usedFallback; remainingStart is a one-based UTF-16 index into the original replacement input

See also

SearchAndReplaceTextInContent, SearchAndReplaceTextInContentEx, SearchText