Skip to main content

Module destinations

Module destinations 

Source
Expand description

Destinations (ISO 32000-1 §12.3.2): a location and view within the document that a bookmark or link navigates to. A destination is either explicit — an array [page /Fit …] naming a page object (or, for remote go-to actions, a page number) and a view — or named: a name/string that indirects through one of two registries to such an array.

Named destinations live in two places, both consulted here:

  • the modern /Root /Names /Dests name tree (PDF 1.2+), whose values are either a destination array or a << /D array >> dictionary, and
  • the legacy /Root /Dests dictionary (a flat name → destination map), still emitted by older producers and by Word.

This module resolves either form into a Destination carrying the target page index (when the page reference belongs to this document’s page tree), the raw page reference, and the DestView. It only reads the object graph; nothing here renders.

Structs§

Destination
A resolved destination: where in the document to go, and how to view it.

Enums§

DestView
How a destination positions and zooms the target page (ISO 32000-1 Table 151). Coordinates are in the page’s default user space; None for a coordinate means “retain the current value” (a null in the array).

Functions§

resolve_explicit
Resolve an explicit destination value — an array, a name/string (a named destination), a << /D … >> dictionary, or an indirect reference to any of these. This is what a /Dest entry or an action’s /D carries.
resolve_named
Resolve a named destination by its name (the bytes of a name object, or the bytes of a name-tree string key). Tries the /Names /Dests name tree first, then the legacy /Root /Dests dictionary. None if the name is unknown.