Shift the route-D page body by TeX page origin offsets

This commit is contained in:
gloamxun committed 2026-10-23 01:55:28 +08:00
1 parent fb33ac6327
commit 5db7acaff2
7 files changed
+148 -17

No files matched your search

+9 -2
View File
@@ -11,7 +11,7 @@ use std::sync::{Mutex, OnceLock};
use texrra_tex_core::cmr10::Cmr10Metrics;
use texrra_tex_core::math::parse_math;
use texrra_tex_core::pdf::display_lists_to_pdf;
use texrra_tex_core::pdf::{PageOrigin, display_lists_to_pdf_with_origin};
use texrra_tex_core::{Document, Engine, ParagraphFont, ParagraphStyle, Unit, VerticalItem};
const SCALE: i64 = 65_536;
@@ -112,7 +112,14 @@ pub fn pdf_bytes(source: &str) -> Result<Vec<u8>, String> {
list
})
.collect();
Ok(display_lists_to_pdf(&pages, PAGE_HEIGHT_PT))
Ok(display_lists_to_pdf_with_origin(
&pages,
PAGE_HEIGHT_PT,
PageOrigin {
h_offset: document.h_offset,
v_offset: document.v_offset,
},
))
}
/// Apply one paragraph edit to the last route-D document and report page