ExecuteFormFieldScriptWithRepliesJSON

表单字段与 JavaScript

描述

执行 AcroForm 字段事件脚本,同时从 JSON 回放确定性的 app.alert 与 app.response 宿主回复

语法

Delphi

Function TPDFlib.ExecuteFormFieldScriptWithRepliesJSON(Index, Action: Integer; Const Value, Change: WideString; SelStart, SelEnd, Flags: Integer; Const RepliesJSON: WideString): WideString;

参数

Index1 基准表单字段索引
Action事件选择器:0 validate、1 calculate、2 format 或 3 keystroke
Value供给 event.value 的候选字段值
Changekeystroke 事件中供给 event.change 的插入或替换文本
SelStart, SelEndkeystroke 事件前的 0 基准选择范围
Flags组合 1 willCommit、2 fieldFull、4 keyDown、8 modifier 与 16 shift 的位掩码
RepliesJSON包含 app.alert 按钮代码与 app.response 字符串或 null 的有序类型化回复的 JSON 数组或对象

返回值

返回报告执行状态、结果 value、change、rc、选择范围及已消耗宿主对话的 JSON 对象。

备注

不显示 UI 对话框,按请求顺序将脚本中的每个 app.alert 或 app.response 调用与 RepliesJSON 中的下一项进行对验。

若缺失、不匹配或未消耗必需的回复,则不执行文档字段变更。

另请参阅

ExecuteFormFieldScriptJSON, SetFormScriptHostActionMode, GetFormScriptDiagnostics