Skip to content

Action version history ​

This page records PDF Action API changes by version.

Unified Action entry (v12.0.0+) ​

From v12.0.0, ActionCallbackManager is deprecated. Handle PDF Actions with customs.actionExecutor on the PDFViewCtrl.PDFViewer constructor, or with viewerOptions.customs.actionExecutor on UIExtension.PDFUI—not on PDFUI’s own customs. JavaScript Actions never enter this callback; the SDK always runs them internally. The sample below uses PDFViewer.

javascript
const pdfViewer = new PDFViewCtrl.PDFViewer({
    customs: {
        actionExecutor: async (options) => {
            const { ActionType } = PDFViewCtrl.PDF.actions;
            const { type, data } = options.actionData || {};
            switch (type) {
                case ActionType.gotoE: {
                    const { fileName, buffer } = data?.rootFile || {};
                    if (buffer) {
                        await options.pdfViewer.openPDFByFile(buffer, { fileName });
                    }
                    return true; // Handled; skip the SDK default
                }
                case ActionType.uri: {
                    const uri = data?.uri;
                    if (typeof uri !== 'string' || !uri.trim()) {
                        return true; // Missing URI; skip the SDK default
                    }
                    try {
                        const parsedUrl = new URL(uri, window.location.href);
                        if (!['http:', 'https:', 'mailto:'].includes(parsedUrl.protocol)) {
                            return true; // Handled; skip the SDK default
                        }
                    } catch {
                        return true; // Invalid URI; skip the SDK default
                    }
                    return false; // Continue with the SDK default
                }
                default:
                    return false;
            }
        }
    }
});
  • Callback signature: (options) => Promise<boolean>. Return true when custom logic handled the action (SDK skips the built-in path); return false to continue with the default.
  • Read type and data from options.actionData, and context from options.doc, options.ownerQuery, options.pdfViewer, and options.trigger.

v11.0 Action data APIs ​

From v11.0, read and update actions with data APIs on each object instead of the deprecated Action class:

  • getActionData() / getAllActionData()
  • updateAction(targetActionObjNumber, actionData)
  • removeAction(targetActionObjNumber)
  • getAdditionalAction()

Migration samples: PDF Action API Migration Guide (v11.0). Usage: Actions.