Skip to content

happypdf / extractAdditionalActions

Function: extractAdditionalActions()

ts
function extractAdditionalActions(
   aaDict, 
   doc, 
   context?): JavaScriptActionMap;

Defined in: src/api/PDFJavaScriptAction.ts:155

Extract JavaScript actions from an Additional Actions (AA) dictionary.

The context argument disambiguates the shared C key: pass 'field' when reading a form field's AA dictionary (so C maps to calculate) and 'page' when reading a page's AA dictionary (so C maps to pageClose). When omitted, field semantics are used together with the unambiguous page O (pageOpen) key, preserving backwards-compatible behaviour without ever mapping a single C entry to two different actions.

Parameters

ParameterTypeDescription
aaDictPDFDictThe AA dictionary
docPDFDocumentThe document
context?AdditionalActionsContextWhether the dictionary belongs to a field or a page

Returns

JavaScriptActionMap

A map of JavaScript actions

MIT Licensed. A fork of pdf-lib.