Capture and reuse XeLaTeX PDF form contents
This commit is contained in:
1 parent
009fde04f7
commit
c0e2346b05
16 files changed
+706
-53
No files matched your search
@@ -634,12 +634,15 @@ impl Executor {
|
||||
} else if xdv && crate::pdf_device::xdv_paper::Special::parse(&special.bytes).is_some() {
|
||||
xdv_paper_specials.push(shipout.specials.len());
|
||||
None
|
||||
} else if xdv && super::specials::xdv_navigation_operand(&special.bytes).is_some() {
|
||||
} else if xdv && let Some((kind, _)) = super::specials::xdv_navigation_operand(&special.bytes) {
|
||||
if kind == b"bxobj" && let Some(program) = self.xdv_colors.start_page() {
|
||||
shipout.xdv_color_steps.insert(graphics_step, program);
|
||||
}
|
||||
let point = xdv_transform.point(
|
||||
(special.position[0] + horizontal_origin) as f64,
|
||||
(special.position[1] + vertical_origin + b.height) as f64,
|
||||
).map(|coordinate| coordinate.round() as i64);
|
||||
xdv_navigation.push((shipout.specials.len(), graphics_step, point));
|
||||
xdv_navigation.push((shipout.specials.len(), graphics_step, point, *origin));
|
||||
None
|
||||
} else if xdv && self.xdv_setup_special(&special)? {
|
||||
None
|
||||
@@ -856,8 +859,8 @@ impl Executor {
|
||||
device.vertical_origin = offset + v_offset;
|
||||
}
|
||||
let delta = [device.horizontal_origin - horizontal_origin, device.vertical_origin - vertical_origin];
|
||||
for (index, graphics_step, [x, y]) in xdv_navigation {
|
||||
self.ship_xdv_navigation(
|
||||
for (index, graphics_step, [x, y], origin) in xdv_navigation {
|
||||
if let Some(operation) = self.ship_xdv_navigation(
|
||||
&shipout.specials[index],
|
||||
crate::pdf_device::xdv_object::Position {
|
||||
page: self.shipped_pages + 1,
|
||||
@@ -865,8 +868,13 @@ impl Executor {
|
||||
height: device.page_height,
|
||||
magnification,
|
||||
},
|
||||
graphics_step, &mut shipout.pdf_links, files,
|
||||
)?;
|
||||
graphics_step, &mut shipout.pdf_links, origin, files,
|
||||
)? {
|
||||
shipout.pdf_graphics_steps[graphics_step] = Some(operation);
|
||||
}
|
||||
}
|
||||
if let Some(navigation) = &self.state.xdv_navigation {
|
||||
navigation.validate_form_boundary().map_err(|error| self.error(error, current))?;
|
||||
}
|
||||
}
|
||||
if xdv && let Some(navigation) = &mut self.state.xdv_navigation
|
||||
|
||||
Reference in new issue
Block a user