Action Class Documentation

classAction

Namespace:datalogics_interface

Derived classes:
GoToAction, LaunchAction, RemoteGoToAction, URIAction

Detailed Description

An action can involve moving the reader to a new page in the file, for example.

Also, with a PDF Viewer a PDF file can have an Action that runs automatically when a user opens the file, or reaches a specific page.

Applications can support Actions in custom annotation types they add. Only GoTo and URI Actions are supported; you can only use an Action with the interface to move from one part of a file to another or open an external web page.

Referenced by

Uses types

Constructor & Destructor Documentation

Action

Action(const Document &doc, const std::string &type)

Parameters

doc: const Document &

The document in which the action is created.

type: const std::string &

The string corresponding to the action's subtype.

Creates a new action object.

~Action

~Action()

Member Function Documentation

get_pdf_dict

PDFDictget_pdf_dict()

Returns:

The underlying PDF dictionary for this Action.

Retrieve the PDFObject representation of this object.

get_subtype

std::stringget_subtype()

Returns:

The subtype string for this action, such as "GoTo", "URI", "Launch", or "GoToR".

The action's subtype.

operator==

booloperator==(const Action &other)

Parameters

Returns:

true if the two objects refer to the same action, false otherwise.

Two Actions are considered equal if they refer to the same underlying PDF action object.

to_string

std::stringto_string()

Returns:

A string describing this Action.

The string includes the action's subtype.

try_as

T *try_as(typename T)

Parameters

: typename T

Returns:

T *

Attempt to downcast this action to a derived type. Returns a pointer to the derived type, or nullptr if the type doesn't match.

try_as

const T *try_as(typename T)

Parameters

: typename T

Returns:

const T *

Const overload of try_as(). Returns a const pointer, or nullptr.