Ship XDV annotations from measured page ranges
This commit is contained in:
1 parent
515dbe6181
commit
20986b2fd5
16 files changed
+873
-54
No files matched your search
@@ -400,6 +400,7 @@ impl Executor {
|
||||
let mut has_space_nodes = false;
|
||||
let mut has_explicit_space = false;
|
||||
let mut pdf_objects = Vec::new();
|
||||
let mut xdv_annotations = std::collections::BTreeMap::new();
|
||||
for (index, output) in outputs.into_iter().enumerate() {
|
||||
while font_uses.peek().is_some_and(|usage| usage.before_output == index) {
|
||||
self.current = current;
|
||||
@@ -461,6 +462,9 @@ impl Executor {
|
||||
shipout.xdv_color_steps.insert(graphics_step, program);
|
||||
}
|
||||
None
|
||||
} else if xdv && crate::pdf_device::xdv_annotation::Command::recognize(&special.bytes).is_some() {
|
||||
xdv_annotations.insert(graphics_step, shipout.specials.len());
|
||||
None
|
||||
} else if xdv && self.xdv_page_special(
|
||||
&special,
|
||||
crate::pdf_device::xdv_object::Position {
|
||||
@@ -469,6 +473,7 @@ impl Executor {
|
||||
height: device.page_height,
|
||||
magnification: device.magnification,
|
||||
},
|
||||
graphics_step,
|
||||
&mut shipout.pdf_links,
|
||||
files,
|
||||
)? {
|
||||
@@ -633,6 +638,9 @@ impl Executor {
|
||||
links.xdv_destinations = std::mem::take(&mut shipout.pdf_links.xdv_destinations);
|
||||
shipout.pdf_links = links;
|
||||
}
|
||||
if xdv && (!xdv_annotations.is_empty() || self.xdv_annotations.is_active()) {
|
||||
shipout.pdf_links.xdv_annotations = self.ship_xdv_annotations(&shipout, &xdv_annotations, files)?;
|
||||
}
|
||||
if let Some(pdf) = &mut shipout.device.pdf && xdv {
|
||||
shipout.pdf_background = self.xdv_colors.background();
|
||||
self.state.xdv_setup.apply_version(&mut pdf.file);
|
||||
|
||||
Reference in new issue
Block a user