Resolve FitR destinations using shipped box geometry

This commit is contained in:
gloamxun committed 2026-11-21 05:18:07 +08:00
1 parent 22154b53a6
commit 003d5d8726
8 files changed
+123 -40

No files matched your search

+4
View File
@@ -2512,6 +2512,10 @@ fn write_pdf(
DestinationView::FitV => format!("/FitV {x}"),
DestinationView::FitBH => format!("/FitBH {y}"),
DestinationView::FitBV => format!("/FitBV {x}"),
DestinationView::FitR([left, top, right, bottom]) => {
let coordinates = [left, height - bottom, right, height - top].map(physical);
format!("/FitR {}", coordinates.join(" "))
}
};
if let Some(number) = destination.structure {
use std::collections::btree_map::Entry;