Repository navigation
Description
Summary
I read research papers with a Markdown note beside a PDF in ZenNotes. I want to link a sentence in my notes to the corresponding location in the paper, then return to that location by opening the link.
There are two parts to this workflow: copying a source link from the current PDF view, and consistently following that link with either the mouse or Vim gd.
Feature request: Copy link to current PDF location
Please consider a Copy link to current location action in the PDF/reference viewer, available from a context menu or toolbar.
The output should be a ready-to-paste Markdown link to the vault PDF, capturing the current page and, if possible, the within-page position and zoom. For example:
[Paper, p. 3](assets/papers/paper.pdf#page=3&zoom=120,0,400)The filename and values above are illustrative. The point is to create this link from the current view without manually calculating coordinates or constructing URL fragments. This is a request for a viewport/source location link, not for PDF annotation editing or a persistent text-selection identifier.
ZenNotes already has PDF page/search/zoom fragment support; the missing workflow is a convenient way to generate a link to the location currently being read.
Bug: Mouse activation loses the location, while Vim gd preserves it
Environment: ZenNotes desktop 2.86.0, macOS, Vim enabled.
With a local multi-page vault PDF, put a link such as the following into a note, replacing the filename with an existing PDF containing at least three pages:
[Source](assets/papers/paper.pdf#page=3&zoom=150)- Open the PDF link using the mouse via the normal note-link opening path.
- The PDF opens in an asset tab at the beginning/default zoom rather than the requested location.
- Put the cursor on the same link in the editor and use lowercase
gdin Vim normal mode. gdtakes a different PDF-specific path, pinning the PDF in the reference pane with the fragment preserved.
Expected: Mouse activation should honor the same page/zoom/location parameters as gd. It should not be necessary to use Vim to follow a PDF source link correctly. The exact choice of asset tab versus reference pane can follow the application's normal UX, but the location should survive.
Source-level findings in the installed 2.86.0 package
The installed app.asar contains the following routing difference:
Paths below are inside the installed app.asar:
node_modules/@zennotes/shared-domain/src/asset-path-resolution.ts:resolveAssetPathAmong()returns the bare file path afterstripQueryAndHash()/decodeHrefPath(). Removing the fragment for file lookup itself is reasonable.node_modules/@zennotes/app-core/src/lib/open-wikilink-attachment.ts:openWikilinkAttachment()then callsstate.openNoteInTab(assetTabPath(assetPath))without carrying the original fragment separately.node_modules/@zennotes/app-core/src/components/EditorPane.tsx:AssetTabViewresolves that bare asset path and uses<iframe src={assetUrl}>, so the viewer never receives the requested page/zoom.- In contrast,
node_modules/@zennotes/app-core/src/components/Editor.tsxregistersgoToDefinitionwith a PDF-specific branch that readshrefFragment(target)and passes it topinAssetReferenceForNote(...).PinnedReferencePane.tsxappends this fragment to the iframe URL.
For example, the asset-tab route reduces a target such as assets/papers/paper.pdf#page=3&zoom=150 to zen://asset/assets%2Fpapers%2Fpaper.pdf, losing the fragment before the viewer opens it.
A source-level test running the installed resolver, attachment-opening helper and gd action with a fixture asset/mock store reproduced this difference for #page=3&zoom=150, #page=3&zoom=120,0,400, and #page=3&search=theorem: all three fragments were lost on the asset-tab path and preserved by gd.
This test captures routing arguments; it is not a GUI automation test or a claim that every Chromium PDF option renders correctly. It is separate from the observed mouse-opening behavior.
Desired round trip
PDF location → copy Markdown source link → paste into note → open with mouse or gd → return to that location.
The location-copy action would make these links practical to create, and preserving the fragment across mouse activation would make them practical to use. Happy for these two parts to be tracked separately if preferred.
Related issues
- pdf highlighs - issues and ideas for improvement #136 discusses broader PDF annotations/highlight links; this request is narrower: copying a link from the current PDF viewport, without needing annotation support.
- [feat] Extended PDF Integration #295 added PDF URL-fragment support in 2.13.2. The bug above concerns a later asset-tab opening path in 2.86.0 that drops those already-supported fragments; it is not a request to implement PDF fragment support from scratch.
Activity
Feat(pdf): links open at their page, and copy a link to the page you …
Feat(pdf): a followed link marks the line it lands on
adibhanna commentedon Nov 18, 2026
Thank you for such a thorough report, the source-level trace made the bug quick to pin down. Both parts are done and ship in 2.87.0.
Links keep their location with the mouse. A link like
[Source](assets/papers/paper.pdf#page=3&zoom=150)now opens at that page and zoom however you follow it: Cmd/Ctrl-click in the editor, a click in Read mode, a PDF embed's Open button, a PDF card, orgd. A click still opens the PDF in its own tab andgdstill pins it in the reference pane, but both land on the same spot. Following the same link again after reading on brings you back to it.Copy a link to where you are reading. In a PDF tab, press Copy link at the top right (the link icon in the reference pane does the same), run Copy Link to PDF Location from the command palette, or press
Space Pin Vim mode (Escape first if the PDF has the keyboard). You get a ready-to-paste link such as:It records the page, the zoom and the line you are reading, so following it brings that line back into view, and a short yellow highlight marks it as the PDF lands. If the top of a page is in view when you copy, the link names the whole page, and following it outlines that page instead. Copying needs the desktop app, since it reads the position from the built-in PDF viewer. Links opened in the web app still go to their page.
Commits: 5ad0f48 (links keep their location, Copy link), f77536e (a card for an already-pinned PDF goes to its own page), 3c4edd7 (the highlight).
Docs(whats-new): 2.87.0 brings PDF links to their page, a PDF font si…