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> !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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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 Twhere T: PdfActionPrivate<'a>,