Skip to content

engine: \hyperlink/\hypertarget navigate the PDF, not only the SVG - #202

Merged
tannevaled merged 1 commit into
mainfrom
internal-pdf-links
Sep 3, 2026
Merged

engine: \hyperlink/\hypertarget navigate the PDF, not only the SVG#202
tannevaled merged 1 commit into
mainfrom
internal-pdf-links

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

What

An in-document jump — a \hyperlink to a \hypertarget, a TOC click — was live in the SVG (<a href="#name"> / <g id>) but inert in the PDF, because the writer had no named-destination API.

How

go-pdfkit v0.8.0 adds AddNamedDest/AddNamedLink and the /Names /Dests name tree (go-pdfkit/pdfkit#22). pdfDraw.internalLink (previously a no-op that only drew the box) now registers a named /Dest at a \hypertarget's top-left and a /GoTo /Link over a \hyperlink that jumps to that name (coordinates flipped into PDF y-up). Bumps go-pdfkit v0.7.0 → v0.8.0.

Verification

End-to-end test: a rendered \hyperlink/\hypertarget PDF carries /Names·/Dests·/GoTo with the destination name. Full engine suite, go vet, gofmt green; rebased on current main (#201).

Completes in-document PDF navigation, the counterpart of the external \href links (#198).

🤖 Generated with Claude Code

An in-document jump — a \hyperlink to a \hypertarget, a table-of-contents click —
was live in the SVG (<a href="#name"> / <g id>) but inert in the PDF, because the
writer had no named-destination API.

go-pdfkit v0.8.0 adds AddNamedDest/AddNamedLink and the /Names /Dests name tree, so
pdfDraw.internalLink now registers a named /Dest at a \hypertarget's top-left and a
/GoTo /Link annotation over a \hyperlink that jumps to that name (coordinates
flipped into PDF y-up). Bumps go-pdfkit v0.7.0 -> v0.8.0.

Verified end-to-end: a rendered \hyperlink/\hypertarget PDF carries /Names //Dests
//GoTo with the destination name; full engine suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 17296db into main Sep 3, 2026
18 checks passed
@tannevaled
tannevaled deleted the internal-pdf-links branch September 3, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant