SetFormScriptLimits
Forms, JavaScript safety
Description
Configures independent limits for form-script source length, interpreter operations, parser nesting, string values and object-property accesses
Syntax
Delphi
Function TPDFlib.SetFormScriptLimits(MaxScriptLength, MaxOperations, MaxNestingDepth, MaxStringLength, MaxPropertyAccesses: Integer): Integer;
ActiveX
Function PDFlib::SetFormScriptLimits(MaxScriptLength As Long, MaxOperations As Long, MaxNestingDepth As Long, MaxStringLength As Long, MaxPropertyAccesses As Long) As Long
Available on IPDFlibrary4 from type library version 3.5
DLL
int DLSetFormScriptLimits(int InstanceID, int MaxScriptLength, int MaxOperations, int MaxNestingDepth, int MaxStringLength, int MaxPropertyAccesses);
Parameters
| MaxScriptLength | Source-character limit from 1,024 to 1,048,576 |
|---|---|
| MaxOperations | Interpreter-operation limit from 64 to 1,000,000 |
| MaxNestingDepth | Parser nesting limit from 8 to 256 |
| MaxStringLength | Per-string character limit from 1,024 to 16,777,216 |
| MaxPropertyAccesses | Object-property access limit from 16 to 1,000,000 |
Return values
Returns 1 when all limits are accepted, or 0 with LastErrorCode 708 when any value is outside its range
Remarks
The defaults are 65,536 source characters, 4,096 operations, 64 nesting levels, 1,048,576 string characters and 4,096 property accesses
The same limits apply to direct field-event execution, recalculation and dependency analysis
These configurable limits apply to the AcroForm JavaScript subset; XFA FormCalc has separate fixed bounds documented by EvaluateXFAFormCalc
See also
GetFormScriptLimitsJSON, GetFormScriptDiagnostics, ExecuteFormFieldScriptEvent