Apply XDV color state and page backgrounds at shipout

This commit is contained in:
gloamxun committed 2026-11-25 20:09:15 +08:00
1 parent cc147e93d8
commit 8be7867b37
10 files changed
+590 -19

No files matched your search

+5
View File
@@ -713,6 +713,11 @@ fn page_content(
let ratio = f64::from(list.magnification) / 1000.0;
content.push_str(&format!("{ratio:.3} 0 0 {ratio:.3} 0 0 cm\n"));
}
if let Some(color) = &list.pdf_background {
content.push_str(&format!(
"q\n{}\n0 0 {} {} re f\nQ\n", color.literal(), pt(list.width), pt(height)
));
}
if let Some(DisplayItem::Background(color)) = list.items.first() {
content.push_str(&format!(
"{:.3} {:.3} {:.3} rg\n0 0 {} {} re f\n0 0 0 rg\n",