Skip to main content

ActionKind

Enum ActionKind 

Source
pub enum ActionKind {
Show 19 variants GoTo { page_index: Option<usize>, raw_dest: Option<String>, }, GoToR { file: Option<String>, new_window: Option<bool>, raw_dest: Option<String>, }, GoToE { file: Option<String>, raw_dest: Option<String>, }, Launch { file: Option<String>, new_window: Option<bool>, }, Thread, Uri { uri: String, is_map: bool, }, Sound, Movie, Hide { hide: bool, target: Option<String>, }, Named { name: String, }, SubmitForm { url: Option<String>, flags: u32, }, ResetForm { flags: u32, }, ImportData { file: Option<String>, }, JavaScript { script: String, }, SetOcgState { on_count: usize, off_count: usize, toggle_count: usize, }, Rendition, Trans, GoTo3DView, Other { kind: String, },
}
Expand description

Typed action payload — Table 198’s 18 action types.

Variants§

§

GoTo

/S /GoTo — in-document jump (§12.6.4.2 Table 199). /D is either an explicit [page-ref mode args …] array (caller can re-decode via crate::reader::link) or a named destination (Name / string).

Fields

§page_index: Option<usize>

0-based page index when the /D array was explicit and the page-ref resolved cleanly.

§raw_dest: Option<String>

Raw /D value — Name, byte-string, or explicit-array debug form — preserved for callers that need the untouched destination.

§

GoToR

/S /GoToR — remote go-to (§12.6.4.3 Table 200). /F is the Filespec — surfaced as its /UF//F filename string.

Fields

§file: Option<String>

Remote file path / URI from the file specification.

§new_window: Option<bool>

/NewWindow flag.

§raw_dest: Option<String>

Raw /D destination (same shape as Self::GoTo’s raw_dest).

§

GoToE

/S /GoToE — embedded go-to (PDF 1.6 — §12.6.4.4 Table 201). Refers to an embedded file (/T target dict chain).

Fields

§file: Option<String>

External file specification (/F), when present.

§raw_dest: Option<String>

Raw /D destination.

§

Launch

/S /Launch — launch external app or open external file (§12.6.4.5 Table 202).

Fields

§file: Option<String>

/F filename for the file to launch.

§new_window: Option<bool>

/NewWindow flag.

§

Thread

/S /Thread — go-to-article-thread (§12.6.4.6).

§

Uri

/S /URI — open a URL (§12.6.4.7 Table 206). /URI is the ASCII-encoded URI; /IsMap marks form-coordinate posting.

Fields

§uri: String

/URI string.

§is_map: bool

/IsMap flag.

§

Sound

/S /Sound — play a sound (§12.6.4.8 Table 207).

§

Movie

/S /Movie — play a movie (§12.6.4.9 Table 208). Legacy (replaced by Rendition in PDF 1.5).

§

Hide

/S /Hide — show / hide annotations (§12.6.4.10 Table 209).

Fields

§hide: bool

/H flag — true means hide (the default), false means show.

§target: Option<String>

/T target annotations (annotation names or refs). Surfaced as the raw string form for arrays / names.

§

Named

/S /Named — invoke a predefined action by name (§12.6.4.11 Table 211).

Fields

§name: String

/N — name of the predefined action (NextPage, PrevPage, FirstPage, LastPage, plus authoring-tool / viewer extensions).

§

SubmitForm

/S /SubmitForm — submit form data to a URL (§12.7.5.2 Table 236).

Fields

§url: Option<String>

/F URL the submission posts to.

§flags: u32

/Flags — Table 237 bit flags. Bit 1 = Include/Exclude, 2 = IncludeNoValueFields, 3 = ExportFormat, 4 = GetMethod, 5 = SubmitCoordinates, 6 = XFDF, …

§

ResetForm

/S /ResetForm — reset form-field values (§12.7.5.3 Table 239).

Fields

§flags: u32

/Flags bit 1 = Exclude (otherwise Include).

§

ImportData

/S /ImportData — import form data from a file (§12.7.5.4 Table 240).

Fields

§file: Option<String>

/F source filename.

§

JavaScript

/S /JavaScript — execute JavaScript (§12.6.4.16 Table 217). /JS is either a literal-string or a stream of UTF-8 / UTF-16 JavaScript source — round-36 recovers it to a String through the same PDFDocEncoding / UTF-16BE-BOM lossy decoder the rest of the reader uses.

Fields

§script: String

JavaScript source text.

§

SetOcgState

/S /SetOCGState — toggle optional-content groups (§12.6.4.12 Table 212). The state array is preserved as the count of On/Off/Toggle entries.

Fields

§on_count: usize

Number of /ON entries in the state array.

§off_count: usize

Number of /OFF entries in the state array.

§toggle_count: usize

Number of /Toggle entries in the state array.

§

Rendition

/S /Rendition — multimedia rendition (§12.6.4.13 Table 213). PDF 1.5 — replaces the legacy Movie / Sound types.

§

Trans

/S /Trans — slide-show transition (§12.6.4.14).

§

GoTo3DView

/S /GoTo3DView — change 3D camera view (§12.6.4.15 Table 215).

§

Other

/S value the round didn’t decode — name surfaced verbatim.

Fields

§kind: String

Raw /S action-type name.

Trait Implementations§

Source§

impl Clone for ActionKind

Source§

fn clone(&self) -> ActionKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActionKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V