pub enum ActionType {
Uri,
GoTo,
GoToR,
Named,
JavaScript,
SubmitForm,
Launch,
ImportData,
Unknown(String),
}Expand description
Known PDF action types per ISO 32000-2 §12.6.4.
The non-Unknown variants are the action subtypes the parser
recognizes and decodes into typed Action values. Unknown
preserves the original /S name so callers can still log or audit
vendor-extension actions without losing information.
Variants§
Uri
/URI — open a URL in the default browser.
GoTo
/GoTo — jump to a destination within the same document.
GoToR
/GoToR — jump to a destination in another (remote) PDF file.
Named
/Named — execute one of the PDF-defined named actions
(NextPage, FirstPage, Print, Find, …).
JavaScript
/JavaScript — execute embedded JavaScript. Security-sensitive;
see is_inert_on_flatten.
SubmitForm
/SubmitForm — POST form data to a remote URL.
Security-sensitive.
Launch
/Launch — launch an external application or open a local file.
Highly security-sensitive (arbitrary code execution path).
ImportData
/ImportData — import FDF form data from an external file.
Security-sensitive.
Unknown(String)
An action subtype the parser did not recognize. The inner string
preserves the original /S name verbatim so callers can audit
vendor extensions.
Implementations§
Source§impl ActionType
impl ActionType
Sourcepub fn from_name(name: &str) -> Self
pub fn from_name(name: &str) -> Self
Map a PDF /S action-type name (without leading slash) to an
ActionType. Unknown names are preserved verbatim in the
Unknown variant.
Sourcepub fn is_inert_on_flatten(&self) -> bool
pub fn is_inert_on_flatten(&self) -> bool
Whether this action type should be stripped (made inert) when flattening the document.
true for actions that have side effects beyond navigation —
JavaScript, SubmitForm, Launch, ImportData. A flattened
PDF is meant to be a static archival artifact; any of these
actions surviving into the flattened output is a security and
archival-fidelity concern. Use this to decide whether to drop
the action during flattening.
Trait Implementations§
Source§impl Clone for ActionType
impl Clone for ActionType
Source§fn clone(&self) -> ActionType
fn clone(&self) -> ActionType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ActionType
impl Debug for ActionType
Source§impl PartialEq for ActionType
impl PartialEq for ActionType
Source§fn eq(&self, other: &ActionType) -> bool
fn eq(&self, other: &ActionType) -> bool
self and other values to be equal, and is used by ==.impl Eq for ActionType
impl StructuralPartialEq for ActionType
Auto Trait Implementations§
impl Freeze for ActionType
impl RefUnwindSafe for ActionType
impl Send for ActionType
impl Sync for ActionType
impl Unpin for ActionType
impl UnsafeUnpin for ActionType
impl UnwindSafe for ActionType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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