Emit multi-page route-D PDFs

This commit is contained in:
gloamxun committed 2026-10-20 18:11:06 +08:00
1 parent b6fab85f61
commit 7dd3961e21
2 files changed
+56 -18

No files matched your search

+11
View File
@@ -1322,6 +1322,17 @@ mod tests {
assert_eq!(halign.cell_box(2, 0), Some((30, 110)));
}
#[test]
fn multi_page_pdf_lists_each_page() {
let document = Document::new(400, vec![Unit::paragraph(1, "a"), Unit::paragraph(2, "b")]);
let engine = Engine::layout(&document);
let list = engine.pages()[0].display_list();
let pages = vec![list.clone(), list];
let pdf = crate::pdf::display_lists_to_pdf(&pages, 400 * 65_536);
let text = String::from_utf8_lossy(&pdf);
assert!(text.contains("/Count 2"));
assert_eq!(text.matches("/Type /Page ").count(), 2);
}
#[test]
fn display_list_writes_a_minimal_pdf() {
let document = Document::new(400, vec![Unit::paragraph(1, "hello")]);