GoToAction Class Documentation

class GoToAction : Action

Namespace:datalogics_interface

Inherits from:
Action

Detailed Description

A go-to action can be executed in a PDF document.

A go-to action includes a hyperlink that, when clicked, takes the reader to a different place within the same document.

The action is linked to a bookmark within the document.

A remote go-to action includes a hyperlink that takes the reader to a destination in a separate document.

Constructor & Destructor Documentation

GoToAction

GoToAction(Document & doc, const std::string & named_destination)

Parameters

named_destination: const std::string &

Create a GoTo action that resolves a named destination at view time. The named destination is looked up in the document's /Names/Dests name tree when the action fires; use NameTree::put(name, dest) (or the equivalent string-keyed put) to register it.

~GoToAction

~GoToAction()

Member Function Documentation

clear_destination

void clear_destination()

Returns:

void

Removes the destination from this action.

get_pdf_dict

PDFDict get_pdf_dict()

Returns:

PDFDict

The underlying PDF dictionary for this Action.

Retrieve the PDFObject representation of this object.

get_subtype

std::string get_subtype()

Returns:

std::string

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

The action's subtype.

operator==

bool operator==(const Action & other)

Parameters

Returns:

bool

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

Determines whether this Action is equal to another.

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

set_destination

void set_destination(const ViewDestination & dest)

Parameters

dest: const ViewDestination &

The ViewDestination to set, or null to remove.

Returns:

void

The ViewDestination that this go-to action navigates to.

Setting the destination to null removes the destination entry from the action dictionary.

to_string

std::string to_string()

Returns:

std::string

A string describing this Action.

Returns a string representation of 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.