PdfAction

Enum 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>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a> From<PdfActionEmbeddedDestination<'a>> for PdfAction<'a>

Source§

fn from(action: PdfActionEmbeddedDestination<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PdfActionLaunch<'a>> for PdfAction<'a>

Source§

fn from(action: PdfActionLaunch<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PdfActionLocalDestination<'a>> for PdfAction<'a>

Source§

fn from(action: PdfActionLocalDestination<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PdfActionRemoteDestination<'a>> for PdfAction<'a>

Source§

fn from(action: PdfActionRemoteDestination<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PdfActionUnsupported<'a>> for PdfAction<'a>

Source§

fn from(action: PdfActionUnsupported<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<PdfActionUri<'a>> for PdfAction<'a>

Source§

fn from(action: PdfActionUri<'a>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for PdfAction<'a>

§

impl<'a> !RefUnwindSafe for PdfAction<'a>

§

impl<'a> !Send for PdfAction<'a>

§

impl<'a> !Sync for PdfAction<'a>

§

impl<'a> Unpin for PdfAction<'a>

§

impl<'a> !UnwindSafe for PdfAction<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'a, T> PdfActionCommon<'a> for T
where T: PdfActionPrivate<'a>,