A PDF action is similar to a web hyperlink, but it’s much more flexible. Nutrient supports most common actions defined in Adobe’s PDF Reference (page 417ff).

The most common types are GoTo and URI. However, many documents also use GoToR, Launch, Named, or JavaScript for page changes.

ActionUse case
GoToGo to a destination (page) in the current document.
GoToRGo to a destination in another document.
GoToEGo to a destination in an embedded file.
LaunchLaunch an application, usually to open a file.
URIResolve a uniform resource identifier (web link).
HideSet an annotation’s hidden flag.
JavaScriptExecute a JavaScript script.
RenditionControl the playing of multimedia content.
SubmitFormSend data to a uniform resource locator.
ResetFormSet fields to their default values.
NamedExecute an action predefined by the conforming reader.

Unsupported actions include Thread, Sound, Movie, ImportData, SetOCGState, Trans, and GoTo3DView.

Bookmark and OutlineElement also contain an Action, thereby supporting the same types of actions as an annotation. (A PDF outline can open a web link or even play a video.)

Intercepting actions

You can intercept actions by implementing the onShouldExecuteAction callback on NutrientView and returning false to prevent the action from executing:

<NutrientView
ref={this.pdfRef}
document={documentPath}
onShouldExecuteAction={(event: ShouldExecuteActionEvent) => {
// Inspect the `actionType` and URL and optionally allow the action to proceed.
this.pdfRef.current?.executeAction(event.requestId, true);
}}/>
fragmentTag="PDF1"
style={styles.pdfColor}
/>