This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/android/forms/pdf-actions-support.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. PDF form actions for Android apps

PDF actions define behavior such as navigation, form submission, and script execution. Nutrient supports common actions from Adobe’s PDF Reference, starting on page 417.

GoTo and URI are the most common action types. Documents also use named actions for page changes.

Nutrient can parse each Action subclass from a PDF:

ActionNutrient classUse case
GoToGoToActionGo to a page in the current document.
URIUriActionOpen a URI, such as a web link.
HideHideActionSet an annotation’s hidden flag.
NamedNamedActionExecute an action that the PDF reader defines.
SubmitFormSubmitFormActionSubmit form data.
ResetFormResetFormActionReset fields to their default values.
JavaScriptJavaScriptActionExecute a JavaScript script.

For script support, refer to the JavaScript guide.

Chain actions through getSubActions. LinkAnnotation and WidgetAnnotation can contain actions.

An OutlineElement also contains an action and supports the same action types. For example, a PDF outline entry can open a web link.

Trigger events

A WidgetAnnotation can contain additional actions, each associated with an AnnotationTriggerEvent.

Nutrient parses all trigger events but executes actions only for the following events. It ignores unsupported events:

EventUse case
MOUSE_DOWNExecutes an action when a user touches an annotation.
MOUSE_UPExecutes an action when a user lifts their finger after tapping an annotation.
RECEIVE_FOCUSExecutes an action when a user selects an annotation.
LOOSE_FOCUSExecutes an action when a user deselects an annotation.
FORM_CHANGEDExecutes JavaScript when a user types in a text or combo box field or changes a list box selection. The action can reject or modify the keystroke.
FIELD_FORMATExecutes JavaScript before formatting a form field.
FORM_VALIDATEExecutes JavaScript to validate a changed field value.
FORM_CALCULATEExecutes JavaScript to recalculate a field’s value when another field changes.

For compatibility with older PDF specifications, Nutrient prioritizes annotation actions from getAction() over additional MOUSE_UP actions.

Form field events (FORM_CHANGED, FIELD_FORMAT, FORM_VALIDATE, and FORM_CALCULATE) support only JavaScriptAction.

Executing actions

Use PdfFragment#executeAction to execute PDF actions:

annotation.action?.let { action ->
fragment.executeAction(action)
}

Provide an ActionSender to specify the execution context:

formElement.annotation.action?.let { action ->
fragment.executeAction(action, ActionSender(formElement))
}

Always provide ActionSender when executing JavaScriptAction for a form field. Without it, Nutrient executes the script at document level. The script can’t format or validate the field, and event.target refers to the document instead.