mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-01 05:58:12 -06:00
A /XYZ destination with a null (or unusable) left or top went to the top of the target page. ISO 32000-2 §12.3.2.2 says a null value keeps the current one, and Acrobat Reader, observed on a synthetic two-page fixture at 400 %, keeps the user-space point at the window's top-left on the new page at the same zoom. CAD exports (WSCAD) write every cross-reference as [page /XYZ null null 0], so following one zoomed in landed on the sheet's title row instead of where the reader was looking. go_to_dest now reads the place at the window's top-left before the jump and uses it for the null coordinates, along each axis the page overflows; a page that fits keeps the layout's own placement. Null /FitH top and /FitV left still go to the page edge. Tests: a unit test (zoomed, partly given, view turned a quarter, page that fits) and an end-to-end click on such a link at 400 %, both seen failing with the fix reverted. The malformed-bookmark case in bookmark_destinations_scroll_to_their_position now expects the kept place, as DestView documents unusable operands as null. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>