#[non_exhaustive]pub enum AnnotLinkAction {
Uri(String),
GoTo {
page: ObjRef,
view: AnnotGoToView,
},
Named {
name: String,
page: ObjRef,
view: AnnotGoToView,
},
NamedExisting {
name: String,
},
GoToR {
file: String,
dest: AnnotRemoteDest,
new_window: Option<bool>,
},
Launch {
file: String,
},
}Expand description
Write-side link action, aligned with pdfrum_doc::ActionKind values we
support on annotations.
Reuses the document Action model conceptually (URI, GoTo); this enum is
the typed payload AnnotSpec::Link writes into /A. A Self::Named
action also upserts /Names /Dests so reopen/navigation can resolve the
name (see set_named_destination). Self::NamedExisting writes the
same /D string but does not touch the name tree — use it when the
destination is already registered.
use pdfrum_edit::AnnotLinkAction;
let a = AnnotLinkAction::Uri("https://example.test/".into());
assert!(matches!(a, AnnotLinkAction::Uri(_)));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Uri(String)
Resolve a URI (/S /URI).
GoTo
Go to a page in this document (/S /GoTo with an explicit destination
array naming page).
Fields
page: ObjRefPage object reference (the same refs crate::EditDoc::page_state returns).
view: AnnotGoToViewHow to display that page.
Named
GoTo whose /D is a named destination string.
Also registers (or updates) name under the catalog /Names /Dests
tree so pdfrum_doc::nav::lookup_named_dest can resolve it after save.
Fields
view: AnnotGoToViewHow to display that page.
NamedExisting
GoTo whose /D is a named destination that must already exist.
Unlike Self::Named, this does not upsert /Names /Dests — the
name is assumed to resolve already (or will be registered separately
via set_named_destination).
GoToR
Remote go-to (/S /GoToR): open file at AnnotRemoteDest.
/F is written as a filespec dictionary with /F and /UF.
Fields
dest: AnnotRemoteDestPage number + view, or a remote named destination.
Launch
Launch a file / application (/S /Launch).
/F is written as a filespec dictionary with /F and /UF.
Trait Implementations§
Source§impl Clone for AnnotLinkAction
impl Clone for AnnotLinkAction
Source§fn clone(&self) -> AnnotLinkAction
fn clone(&self) -> AnnotLinkAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more