Enum pdfium_render::action::PdfAction
source · pub enum PdfAction<'a> {
LocalDestination(PdfActionLocalDestination<'a>),
RemoteDestination(PdfActionRemoteDestination<'a>),
EmbeddedDestination(PdfActionEmbeddedDestination<'a>),
Launch(PdfActionLaunch<'a>),
Uri(PdfActionUri<'a>),
Unsupported(PdfActionUnsupported<'a>),
}Expand description
The action associated with a clickable link or document bookmark.
Variants§
LocalDestination(PdfActionLocalDestination<'a>)
RemoteDestination(PdfActionRemoteDestination<'a>)
EmbeddedDestination(PdfActionEmbeddedDestination<'a>)
Launch(PdfActionLaunch<'a>)
Uri(PdfActionUri<'a>)
Unsupported(PdfActionUnsupported<'a>)
Implementations§
source§impl<'a> PdfAction<'a>
impl<'a> PdfAction<'a>
sourcepub fn action_type(&self) -> PdfActionType
pub fn action_type(&self) -> PdfActionType
Returns the PdfActionType for this PdfAction.
Note that Pdfium does not support or recognize all PDF action types. For instance,
Pdfium does not currently support or recognize the interactive Javascript action type
supported by Adobe Acrobat or Foxit’s commercial PDF SDK. In these cases,
Pdfium will return PdfActionType::Unsupported.
sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns true if this PdfAction has an action type other than PdfActionType::Unsupported.
The PdfAction::as_local_destination_action(), PdfAction::as_remote_destination_action(), PdfAction::as_embedded_destination_action(), PdfAction::as_launch_action(), and PdfAction::as_uri_action() functions can be used to access properties and functions pertaining to a specific action type.
sourcepub fn is_unsupported(&self) -> bool
pub fn is_unsupported(&self) -> bool
Returns true if this PdfAction has an action type of PdfActionType::Unsupported.
Common properties shared by all PdfAction types can still be accessed for actions not recognized by Pdfium, but action-specific functionality will be unavailable.
sourcepub fn as_local_destination_action(
&self
) -> Option<&PdfActionLocalDestination<'_>>
pub fn as_local_destination_action( &self ) -> Option<&PdfActionLocalDestination<'_>>
Returns an immutable reference to the underlying PdfActionLocalDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInSameDocument.
sourcepub fn as_local_destination_action_mut(
&mut self
) -> Option<&mut PdfActionLocalDestination<'a>>
pub fn as_local_destination_action_mut( &mut self ) -> Option<&mut PdfActionLocalDestination<'a>>
Returns a mutable reference to the underlying PdfActionLocalDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInSameDocument.
sourcepub fn as_remote_destination_action(
&self
) -> Option<&PdfActionRemoteDestination<'_>>
pub fn as_remote_destination_action( &self ) -> Option<&PdfActionRemoteDestination<'_>>
Returns an immutable reference to the underlying PdfActionRemoteDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInRemoteDocument.
sourcepub fn as_remote_destination_action_mut(
&mut self
) -> Option<&mut PdfActionRemoteDestination<'a>>
pub fn as_remote_destination_action_mut( &mut self ) -> Option<&mut PdfActionRemoteDestination<'a>>
Returns a mutable reference to the underlying PdfActionRemoteDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInRemoteDocument.
sourcepub fn as_embedded_destination_action(
&self
) -> Option<&PdfActionEmbeddedDestination<'_>>
pub fn as_embedded_destination_action( &self ) -> Option<&PdfActionEmbeddedDestination<'_>>
Returns an immutable reference to the underlying PdfActionEmbeddedDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInEmbeddedDocument.
sourcepub fn as_embedded_destination_action_mut(
&mut self
) -> Option<&mut PdfActionEmbeddedDestination<'a>>
pub fn as_embedded_destination_action_mut( &mut self ) -> Option<&mut PdfActionEmbeddedDestination<'a>>
Returns a mutable reference to the underlying PdfActionEmbeddedDestination for this PdfAction, if this action has an action type of PdfActionType::GoToDestinationInEmbeddedDocument.
sourcepub fn as_launch_action(&self) -> Option<&PdfActionLaunch<'_>>
pub fn as_launch_action(&self) -> Option<&PdfActionLaunch<'_>>
Returns an immutable reference to the underlying PdfActionLaunch for this PdfAction, if this action has an action type of PdfActionType::Launch.
sourcepub fn as_launch_action_mut(&mut self) -> Option<&mut PdfActionLaunch<'a>>
pub fn as_launch_action_mut(&mut self) -> Option<&mut PdfActionLaunch<'a>>
Returns a mutable reference to the underlying PdfActionLaunch for this PdfAction, if this action has an action type of PdfActionType::Launch.
sourcepub fn as_uri_action(&self) -> Option<&PdfActionUri<'_>>
pub fn as_uri_action(&self) -> Option<&PdfActionUri<'_>>
Returns an immutable reference to the underlying PdfActionUri for this PdfAction, if this action has an action type of PdfActionType::Uri.
sourcepub fn as_uri_action_mut(&mut self) -> Option<&mut PdfActionUri<'a>>
pub fn as_uri_action_mut(&mut self) -> Option<&mut PdfActionUri<'a>>
Returns a mutable reference to the underlying PdfActionUri for this PdfAction, if this action has an action type of PdfActionType::Uri.