Skip to main content

Module scripting

Module scripting 

Source
Expand description

Scripting integration — run FormCalc calculate/validate scripts on form fields.

Implements XFA Spec 3.3 §14.3.2 event model for calculate and validate events. Before layout, the engine executes calculate scripts on fields to compute derived values, then optionally runs validate scripts to check constraints.

NOTE: This module handles simple calculate/validate scripts with a flat interpreter. The more advanced dynamic scripting (initialize events, SOM-based field resolution, presence toggling) lives in pdf-xfa/src/dynamic.rs which uses the full FormTree SOM resolver.

Structs§

ScriptResult
Result of running all scripts on a form tree.

Enums§

ScriptError
Errors from script execution.

Functions§

prepare_form
Run calculate scripts, then layout. Convenience wrapper for the common flow.
run_calculations
Execute all calculate scripts in the form tree, updating field values.
run_validations
Execute all validate scripts in the form tree, collecting failures.