GoToAction Class Documentation
class GoToAction : ActionNamespace: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.
Uses types
Constructor & Destructor Documentation
GoToAction
GoToAction(Document & doc, const std::string & named_destination)Parameters
doc: Document &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(GoToAction && )Parameters
GoToAction
GoToAction(ViewDestination & dest)Parameters
dest: ViewDestination &The ViewDestination contained in this class.
General constructor
~GoToAction
~GoToAction()Member Function Documentation
clear_destination
void clear_destination()Returns:
voidRemoves the destination from this action.
get_destination
std::unique_ptr< ViewDestination > get_destination()Returns:
std::unique_ptr< ViewDestination >The ViewDestination for this action.
The ViewDestination that this go-to action navigates to.
get_pdf_dict
PDFDict get_pdf_dict()Returns:
PDFDictThe underlying PDF dictionary for this Action.
Retrieve the PDFObject representation of this object.
get_subtype
std::string get_subtype()Returns:
std::stringThe subtype string for this action, such as "GoTo", "URI", "Launch", or "GoToR".
The action's subtype.
operator=
GoToAction & operator=(GoToAction && )Parameters
Returns:
GoToAction &operator==
bool operator==(const Action & other)Parameters
other: const Action &
Returns:
booltrue 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:
voidThe 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::stringA 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.