engine: \hyperlink/\hypertarget navigate the PDF, not only the SVG - #202
Merged
Conversation
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>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An in-document jump — a
\hyperlinkto 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/AddNamedLinkand the/Names /Destsname tree (go-pdfkit/pdfkit#22).pdfDraw.internalLink(previously a no-op that only drew the box) now registers a named/Destat a\hypertarget's top-left and a/GoTo/Linkover a\hyperlinkthat 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/\hypertargetPDF carries/Names·/Dests·/GoTowith the destination name. Full engine suite,go vet,gofmtgreen; rebased on current main (#201).Completes in-document PDF navigation, the counterpart of the external
\hreflinks (#198).🤖 Generated with Claude Code