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
| Parameter | Type | Description |
|---|---|---|
aaDict | PDFDict | The AA dictionary |
doc | PDFDocument | The document |
context? | AdditionalActionsContext | Whether the dictionary belongs to a field or a page |
Returns
A map of JavaScript actions