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 /Destsname tree (PDF 1.2+), whose values are either a destination array or a<< /D array >>dictionary, and - the legacy
/Root /Destsdictionary (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§
- Dest
View - How a destination positions and zooms the target page (ISO 32000-1 Table
151). Coordinates are in the page’s default user space;
Nonefor a coordinate means “retain the current value” (anullin 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/Destentry or an action’s/Dcarries. - 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 /Destsname tree first, then the legacy/Root /Destsdictionary.Noneif the name is unknown.