pub struct PdfiumAction { /* private fields */ }Expand description
§Rust interface to FPDF_ACTION
Implementations§
Source§impl PdfiumAction
impl PdfiumAction
Sourcepub fn type(&self) -> PdfiumActionType
pub fn type(&self) -> PdfiumActionType
Returns the type of this action.
Sourcepub fn dest(&self, document: &PdfiumDocument) -> PdfiumResult<PdfiumDestination>
pub fn dest(&self, document: &PdfiumDocument) -> PdfiumResult<PdfiumDestination>
Returns the destination associated with this action, if any.
Returns an error if the action is not a Goto or RemoteGoto action.
Note: In the case of PdfiumActionType::RemoteGoto, you must first call PdfiumAction::file_path(), then load the document at that path, then pass the document handle from that document as |document| to PdfiumAction::dest().
Sourcepub fn file_path(&self) -> PdfiumResult<String>
pub fn file_path(&self) -> PdfiumResult<String>
Returns the file path associated with this action, if any.
Returns an error if the action is not a RemoteGoto or Launch action.
Sourcepub fn uri_path(&self, doc: &PdfiumDocument) -> PdfiumResult<Vec<u8>>
pub fn uri_path(&self, doc: &PdfiumDocument) -> PdfiumResult<Vec<u8>>
Returns the URI Path of the action, in raw bytes.
Note: the returned raw bytes represents a String, but we do not know what encoding the PDF file adopts. If you believe the String is encoded in UTF-8, you can simply call String::from_utf8() to convert the raw bytes into a String.
Trait Implementations§
Source§impl Clone for PdfiumAction
impl Clone for PdfiumAction
Source§fn clone(&self) -> PdfiumAction
fn clone(&self) -> PdfiumAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more