Executed 2026-11-18 · PyMuPDF 1.28.2 · 0 guessed numbers

Do PDF bookmarks survive a split?

Merge loses bookmarks and needs an offset formula. Split is the mirror problem: pages are renumbered 1–n per part, so survivors need a filter and a minus sign. We ran it.

The executed run

The cross-edge finding

C’s two bookmarks straddle the split: C sec1 (merged p6) lands in part2, C sec2 (merged p7) in part3. Ownership is decided by destination page, not by source file — one rule, no special-casing.

The two formulas

Merge
destination_offset = sum(pages of sources before) → +0/+3/+5/+7
Split
keep if start+1 ≤ page ≤ end, then page’ = page − start

Split tools that claim “bookmarks preserved” should show per-part counts. Ours do now, per part, with text-verified targets.