Write XeLaTeX document name trees and attachments

This commit is contained in:
gloamxun committed 2026-11-28 20:54:56 +08:00
1 parent d627614af8
commit dcc6a3984c
9 files changed
+446 -14

No files matched your search

@@ -65,7 +65,7 @@ impl Executor {
};
if kind == b"dest" {
let destination = crate::pdf_device::xdv_destination::Destination::parse(
operands, position.page, position.coordinates,
operands, position.page, position.coordinates, (position.page, graphics_step, 1),
).map_err(|error| self.error(error, special.span))?;
links.xdv_destinations.push(destination);
return Ok(None);
@@ -79,12 +79,14 @@ impl Executor {
.map_err(|error| self.error(error, special.span))?;
graphics = Some(operation);
Ok(warnings)
} else if matches!(kind, b"docview" | b"outline" | b"pageresources") {
} else if matches!(kind, b"docview" | b"outline" | b"pageresources" | b"names") {
let navigation = Arc::make_mut(self.state.xdv_navigation.get_or_insert_with(Default::default));
if kind == b"docview" {
navigation.merge_catalog(operands, position, self.limits.tokens)
} else if kind == b"outline" {
navigation.add_outline(operands, position, (position.page, graphics_step, 1), self.limits.tokens)
} else if kind == b"names" {
navigation.add_names(operands, position, (position.page, graphics_step, 1), self.limits.tokens)
} else {
navigation.set_page_resources(operands, position, self.limits.tokens)
}
@@ -367,6 +369,7 @@ pub(super) fn xdv_navigation_operand(data: &[u8]) -> Option<(&'static [u8], &[u8
(b"docview", b"docview"), (b"outline", b"outline"), (b"out", b"outline"),
(b"obj", b"obj"), (b"object", b"obj"), (b"put", b"put"), (b"close", b"close"),
(b"stream", b"stream"), (b"fstream", b"fstream"), (b"pageresources", b"pageresources"),
(b"names", b"names"),
(b"bxobj", b"bxobj"), (b"bform", b"bxobj"), (b"beginxobj", b"bxobj"),
(b"exobj", b"exobj"), (b"eform", b"exobj"), (b"endxobj", b"exobj"),
(b"uxobj", b"uxobj"), (b"usexobj", b"uxobj"),