Validating PDF Forms Using JavaScript on iOS

PSPDFKit has some support for executing JavaScript attached to a document, annotations, or forms. For more general information about PSPDFKit’s JavaScript support, please see our PDF JavaScript Support guide.

Most form validation scripts should work out of the box, but we’re constantly working on improving the engine and increasing our coverage of the PDF specification’s support for JavaScript.

Supported Formatting API

The following functions for form formatting and validation are supported by PSPDFKit. Please see Adobe’s documentation to learn more about them.

Number Formatting

  • AFNumber_Format, AFNumber_Keystroke, AFMakeNumber

Percent Formatting

  • AFPercent_Format, AFPercent_Keystroke

Date Formatting

  • AFDate_Format, AFDate_FormatEx, AFDate_Keystroke, AFDate_KeystrokeEx, AFTime_Format, AFTime_FormatEx, AFTime_Keystroke

Special Formatting

  • AFSpecial_Format, AFSpecial_Keystroke, AFSpecial_KeystrokeEx

Simple Formatting

  • AFSimple, AFSimple_Calculate

Range Validation

  • AFRange_Validate