Skip to main content

collect_javascript_actions

Function collect_javascript_actions 

Source
pub fn collect_javascript_actions<S: PdfSource>(
    catalog: &Object,
    store: &ObjectStore<S>,
) -> DocResult<Vec<JavaScriptAction>>
Expand description

Collect all JavaScript actions from a document catalog.

Reads the /Names//JavaScript name tree. Each entry value is an action dictionary with /S /JavaScript and /JS (the script string). Entries whose value cannot be parsed as a JavaScript action are silently skipped.

Returns an empty Vec when the catalog contains no JavaScript name tree.

Corresponds to the combination of FPDFDoc_GetJavaScriptActionCount + FPDFDoc_GetJavaScriptAction in fpdf_javascript.h.