Skip to content

Layout: internal links and destinations, not just URIs #299

Done

Description

@Tim81

TextStyle.LinkUri is the only linking mechanism in the Layout API, and it produces a URI action
(DrawContext.AddUriLinkAnnotation). There is no way to link to another point in the same
document
.

The Kernel can do it — PdfLinkAnnotation supports /XYZ page destinations with DestPage,
DestLeft, DestTop — but the Layout API exposes none of that.

Why it blocks two other issues

  • L9 — a table of contents whose entries are not clickable is a poor TOC, and §8.2.5.8 expects a
    TOCI to identify its target.
  • L12 — §8.2.5.14.1 requires an interactive footnote to point to its note via a link annotation.

And §8.8 dictates what kind of link

All destinations … whose target lies within the same document shall be structure destinations.

So this must produce structure destinations (G3), not page destinations. Emitting both — /D for
older readers and /SD for 2.0 ones — is the right shape, as G3 records.

Content that actionably points at other content shall use one or both of: a link annotation with a
structure destination, or the /Ref entry on the source structure element. For a TOC both are
appropriate: /Ref for the structural relationship, the annotation for the click.

Scope

  • Link to an element rather than a coordinate — the caller names a target element, not a page.
  • Structure destinations via G3, with page destinations alongside for compatibility.
  • Named destinations (B14) where a stable external anchor is wanted.
  • The link content shall be contiguous in logical reading order (§8.9.2.4.2), and multiple
    annotations targeting the same location shall share one Link element while ones targeting different
    locations shall be in separate elements (§8.2.5.20) — both constraints the API should uphold rather
    than leave to the caller.

Acceptance

  • A link to a heading resolving correctly, and still resolving after a page is inserted before it.
  • Both /D and /SD emitted.
  • Two links to the same target sharing one Link element; two to different targets not sharing one.
  • veraPDF ua2 green.

Relates to


Plan labels used above, resolved: B14 #262 · G3 #273 · L9 #294 · L12 #297.

Activity

  1. added
    area/layout
    type/feature
    on Aug 29, 2026
  2. Tim81 commented on Nov 18, 2026

    @Tim81
    OwnerAuthor

    Scope for v2.4. The description asks for PDF 2.0 structure destinations. ISO 19005-2 5.1 (read via NEN Connect on
    2026-11-17) admits ISO 32000-1 features only, and /SD is not one, so the PDF/A-2 handbook cannot use it.

    v2.4 delivers (handbook slice):

    Moved to #600 (new issue): structure destinations (/SD, #273) emitted next to /D, and veraPDF ua2
    green. The acceptance bullets "both /D and /SD emitted" and "veraPDF ua2 green" move with it.

    The description's "link content shall be contiguous in logical reading order" and "multiple annotations
    targeting the same location share one Link" stay with this issue.

  3. Tim81 commented on Nov 19, 2026

    @Tim81
    OwnerAuthor

    Scope split (2026-11-19). v2.4 ships page and named destinations (#241, #262) and links from runs to anchors on any block (paragraph, heading, list item, cell, band), including forward references through the position map (#288). The PDF 2.0 half, structure destinations (/SD) validated with veraPDF ua2, is #600 (ISO 19005-2 5.1 limits PDF/A-2 to ISO 32000-1 features; the Kernel side is #273). Tagging links as Link with an OBJR is #550 (v2.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/layouttype/feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions