pub enum Action {
Show 19 variants
GoTo(Destination),
Uri(String),
Named(String),
GoToR {
file: String,
dest: Destination,
new_window: Option<bool>,
},
Launch {
file: String,
},
JavaScript {
code: String,
},
SubmitForm {
url: String,
fields: Vec<String>,
},
ResetForm {
fields: Vec<String>,
},
ImportData {
file: String,
},
Sound,
Movie,
Rendition,
GoToE {
file_spec: Option<String>,
destination: Option<String>,
new_window: Option<bool>,
},
Thread {
thread_ref: Option<String>,
},
Hide {
target: Option<String>,
hide: bool,
},
SetOCGState {
state: Vec<String>,
},
Trans,
GoTo3DView,
Unknown(String),
}Expand description
A PDF action associated with a bookmark, link, or other trigger.
Variants§
GoTo(Destination)
Navigate to a destination within the current document.
Uri(String)
Open a URI.
Named(String)
Execute a named action (e.g., “NextPage”, “PrevPage”).
GoToR
Navigate to a destination in a remote document.
Launch
Launch an application or open a file.
JavaScript
Execute JavaScript code (code not executed, only stored).
SubmitForm
Submit form data to a URL.
ResetForm
Reset form fields.
ImportData
Import data from a file.
Sound
Play a sound (detection only).
Movie
Play a movie (detection only).
Rendition
Rendition action (detection only).
GoToE
Navigate to a destination in an embedded file.
Thread
Navigate to an article thread.
Hide
Show or hide an annotation.
SetOCGState
Set optional content group state.
Trans
Transition action (detection only).
GoTo3DView
Navigate to a 3D view (detection only).
Unknown(String)
Unrecognized action subtype (kUnknown in PDFium).
The /S name is preserved so callers can inspect it.
Corresponds to CPDF_Action::Type::kUnknown in upstream.
Implementations§
Source§impl Action
impl Action
Sourcepub fn has_fields(&self) -> bool
pub fn has_fields(&self) -> bool
Returns true if this action has an associated field list.
Only SubmitForm and ResetForm actions can carry field lists.
Sourcepub fn all_fields(&self) -> &[String]
pub fn all_fields(&self) -> &[String]
Returns the field names associated with this action, if any.
Returns an empty slice for actions that don’t carry field lists.
Corresponds to CPDF_Action::GetAllFields() in PDFium.
Sourcepub fn fields(&self) -> &[String]
👎Deprecated since 0.1.0: use all_fields() instead
pub fn fields(&self) -> &[String]
use all_fields() instead
Convenience helper — same as all_fields().
Returns the field names associated with this action, if any.
Sourcepub fn action_type(&self) -> ActionType
pub fn action_type(&self) -> ActionType
Returns the coarse ActionType classification for this action.
Maps the Action enum variant to the corresponding PDFACTION_*
constant from PDFium’s fpdf_doc.h.
Corresponds to FPDFAction_GetType.
Sourcepub fn action_get_type(&self) -> ActionType
pub fn action_get_type(&self) -> ActionType
ADR-019 alias for action_type().
Corresponds to FPDFAction_GetType.
Sourcepub fn get_type(&self) -> ActionType
👎Deprecated: use action_get_type() — matches upstream FPDFAction_GetType
pub fn get_type(&self) -> ActionType
use action_get_type() — matches upstream FPDFAction_GetType
Convenience alias — use action_get_type().
Sourcepub fn dest(&self) -> Option<&Destination>
pub fn dest(&self) -> Option<&Destination>
Returns the destination of a GoTo or GoToR action, if any.
Returns None if this action is not a GoTo or GoToR variant.
Corresponds to FPDFAction_GetDest.
Sourcepub fn action_get_dest(&self) -> Option<&Destination>
pub fn action_get_dest(&self) -> Option<&Destination>
ADR-019 alias for dest().
Corresponds to FPDFAction_GetDest.
Sourcepub fn get_dest(&self) -> Option<&Destination>
👎Deprecated: use action_get_dest() — matches upstream FPDFAction_GetDest
pub fn get_dest(&self) -> Option<&Destination>
use action_get_dest() — matches upstream FPDFAction_GetDest
Convenience alias — use action_get_dest().
Sourcepub fn file_path(&self) -> Option<&str>
pub fn file_path(&self) -> Option<&str>
Returns the file path of a Launch or GoToR action.
Returns None if this action is not a Launch or GoToR variant.
Corresponds to FPDFAction_GetFilePath.
Sourcepub fn action_get_file_path(&self) -> Option<&str>
pub fn action_get_file_path(&self) -> Option<&str>
ADR-019 alias for file_path().
Corresponds to FPDFAction_GetFilePath.
Sourcepub fn get_file_path(&self) -> Option<&str>
👎Deprecated: use action_get_file_path() — matches upstream FPDFAction_GetFilePath
pub fn get_file_path(&self) -> Option<&str>
use action_get_file_path() — matches upstream FPDFAction_GetFilePath
Convenience alias — use action_get_file_path().
Sourcepub fn uri_path(&self) -> Option<&str>
pub fn uri_path(&self) -> Option<&str>
Returns the URI of a Uri action.
Returns None if this action is not a Uri variant.
Corresponds to FPDFAction_GetURIPath.
Sourcepub fn action_get_uri_path(&self) -> Option<&str>
pub fn action_get_uri_path(&self) -> Option<&str>
ADR-019 alias for uri_path().
Corresponds to FPDFAction_GetURIPath.
Sourcepub fn get_uri_path(&self) -> Option<&str>
👎Deprecated: use action_get_uri_path() — matches upstream FPDFAction_GetURIPath
pub fn get_uri_path(&self) -> Option<&str>
use action_get_uri_path() — matches upstream FPDFAction_GetURIPath
Convenience alias — use action_get_uri_path().
Sourcepub fn get_uri(&self) -> Option<&str>
👎Deprecated: use action_get_uri_path() — matches upstream FPDFAction_GetURIPath
pub fn get_uri(&self) -> Option<&str>
use action_get_uri_path() — matches upstream FPDFAction_GetURIPath
Non-upstream alias — use action_get_uri_path() or uri_path().
Sourcepub fn hide_status(&self) -> Option<bool>
pub fn hide_status(&self) -> Option<bool>
Returns the hide/show state of a Hide action.
Returns None if this action is not a Hide variant.
Corresponds to CPDF_Action::GetHideStatus() in PDFium.
Sourcepub fn get_hide_status(&self) -> Option<bool>
pub fn get_hide_status(&self) -> Option<bool>
ADR-019 alias for hide_status().
Corresponds to CPDF_Action::GetHideStatus() in PDFium.
Sourcepub fn named_action(&self) -> Option<&str>
pub fn named_action(&self) -> Option<&str>
Returns the named action string of a Named action.
Returns None if this action is not a Named variant.
Corresponds to CPDF_Action::GetNamedAction() in PDFium.
Sourcepub fn get_named_action(&self) -> Option<&str>
pub fn get_named_action(&self) -> Option<&str>
ADR-019 alias for named_action().
Corresponds to CPDF_Action::GetNamedAction() in PDFium.
Sourcepub fn flags(&self) -> Option<u32>
pub fn flags(&self) -> Option<u32>
Returns the flags of a SubmitForm action.
Returns None if this action is not a SubmitForm variant.
The flags control which fields are submitted and the submission format
per ISO 32000-1 §12.7.5.2.
Corresponds to CPDF_Action::GetFlags() in PDFium.
Sourcepub fn get_flags(&self) -> Option<u32>
pub fn get_flags(&self) -> Option<u32>
ADR-019 alias for flags().
Corresponds to CPDF_Action::GetFlags() in PDFium.
Sourcepub fn get_all_fields(&self) -> &[String]
pub fn get_all_fields(&self) -> &[String]
ADR-019 alias for all_fields().
Corresponds to CPDF_Action::GetAllFields() in PDFium.
Sourcepub fn maybe_javascript(&self) -> Option<&str>
pub fn maybe_javascript(&self) -> Option<&str>
Returns the JavaScript code of a JavaScript action, if any.
Returns None if this action is not a JavaScript variant.
Corresponds to CPDF_Action::MaybeGetJavaScript() in PDFium.
Sourcepub fn maybe_get_javascript(&self) -> Option<&str>
pub fn maybe_get_javascript(&self) -> Option<&str>
ADR-019 alias for maybe_javascript().
Corresponds to CPDF_Action::MaybeGetJavaScript() in PDFium.
Sourcepub fn javascript(&self) -> String
pub fn javascript(&self) -> String
Returns the JavaScript code of a JavaScript action as a String.
Returns an empty string if this action is not a JavaScript variant
(matching PDFium’s GetJavaScript() which returns empty for non-JS
actions and for an empty JS entry).
Corresponds to CPDF_Action::GetJavaScript() in PDFium.
Sourcepub fn get_javascript(&self) -> String
👎Deprecated: use javascript() — there is no public FPDFAction_GetJavaScript API
pub fn get_javascript(&self) -> String
use javascript() — there is no public FPDFAction_GetJavaScript API
Non-upstream alias — use javascript().