Actions

PDF includes a wide variety of standard action types, whose characteristics and behaviour are defined by an action dictionary. These are defined in this submodule.

Trigger events are the other component of actions, and are specific to their associated object.

class pypdf.actions.Action[source]

Bases: DictionaryObject, ABC

An action dictionary defines the characteristics and behaviour of an action.

class pypdf.actions.JavaScript(js: str)[source]

Bases: Action

Upon invocation of an ECMAScript action, a PDF processor shall execute a script that is written in the ECMAScript programming language. ECMAScript extensions described in ISO/DIS 21757-1 shall also be allowed.

class pypdf.actions.PageTrigger(*values)[source]

Bases: StrEnum

Trigger event entries in a page object’s additional-actions dictionary.

OPEN = 'open'

A PageTrigger object triggering an action when the page is opened.

CLOSE = 'close'

A PageTrigger object triggering an action when the page is closed.