Resolve native PDF structure destinations and local actions

This commit is contained in:
gloamxun committed 2026-11-21 05:04:54 +08:00
1 parent 58bcfca7b7
commit 22154b53a6
11 files changed
+284 -78

No files matched your search

@@ -1,10 +1,12 @@
//! Typed link nodes and the annotations produced when TeX ships their lists.
use super::catalog::CatalogAction;
use crate::execution::Token;
#[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum LinkAction {
User(Vec<Token>),
GotoName(Vec<Token>),
Catalog(CatalogAction),
}
#[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
@@ -45,6 +47,8 @@ pub enum LinkNode {
Destination {
destination: DestinationId<Vec<Token>>,
view: DestinationView,
#[serde(default, skip_serializing_if = "Option::is_none")]
structure: Option<u32>,
},
}
@@ -52,6 +56,7 @@ pub enum LinkNode {
pub enum AnnotationAction {
User(String),
GotoName(String),
Catalog(CatalogAction),
}
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
@@ -69,6 +74,8 @@ pub struct PageDestination {
pub destination: DestinationId<String>,
pub point: [i64; 2],
pub view: DestinationView,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub structure: Option<u32>,
}
#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]