<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dikshant Raj</title>
    <description>The latest articles on DEV Community by Dikshant Raj (@dikshant_raj_1df2bf2d5eb7).</description>
    <link>https://dev.to/dikshant_raj_1df2bf2d5eb7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4147533%2F8c336bf9-db44-4ad9-bf09-d34fb2d11277.jpg</url>
      <title>DEV Community: Dikshant Raj</title>
      <link>https://dev.to/dikshant_raj_1df2bf2d5eb7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dikshant_raj_1df2bf2d5eb7"/>
    <language>en</language>
    <item>
      <title>I built a PDF reader where every note remembers its page</title>
      <dc:creator>Dikshant Raj</dc:creator>
      <pubDate>Mon, 28 Sep 2026 15:52:18 +0000</pubDate>
      <link>https://dev.to/dikshant_raj_1df2bf2d5eb7/i-built-a-pdf-reader-where-every-note-remembers-its-page-34in</link>
      <guid>https://dev.to/dikshant_raj_1df2bf2d5eb7/i-built-a-pdf-reader-where-every-note-remembers-its-page-34in</guid>
      <description>&lt;p&gt;Every time I read a long PDF (a paper, a spec, a book chapter) ended up with the same mess: a list of highlights with no context, a notes file that didn't know where anything came from, and, when I pasted the PDF into an AI assistant, answers that ignored what I actually thought about it.&lt;/p&gt;

&lt;p&gt;So I built Marginalia: a free, open-source PDF reader with a notes canvas next to it. It launched on Product Hunt today.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/N5qtVQgwJpk" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;What it does&lt;br&gt;
Pull a passage onto a canvas. Drag a box over any text (or a diagram) in the PDF and it lands on the canvas as a card.&lt;br&gt;
Write your own note on it, and link cards together. Threads between cards can be labelled supports, contradicts, references, or anything you type.&lt;br&gt;
Click any card to jump straight back to the exact spot in the PDF. Every excerpt remembers its document and page.&lt;br&gt;
Copy for AI. One click turns the whole canvas into a single Markdown file: every excerpt, its page, your note, and how the ideas connect. Paste it into any AI assistant alongside the PDF and ask things like "Where is my argument thin?" or "Quiz me on this chapter."&lt;br&gt;
There's no account and nothing is uploaded. PDFs and notes live in your browser (IndexedDB), and it works offline as a PWA.&lt;/p&gt;

&lt;p&gt;Why a marquee instead of text selection&lt;br&gt;
Selecting text in a PDF with the browser's native selection is painful on anything with columns or tables, because the underlying text order often doesn't match the visual order. Marginalia uses a drag-marquee instead: whatever lines sit inside the box you draw become the excerpt, clustered into rows by position, so tables come out in reading order. If there's no text layer at all (a scanned page), the same gesture captures an image excerpt instead.&lt;/p&gt;

&lt;p&gt;The export format&lt;br&gt;
The Markdown is designed to be read by a model, not just a person:&lt;/p&gt;

&lt;h3&gt;
  
  
  C1 · On-Reading-Slowly.pdf, p.1
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A reader with a stack of index cards could lay out an argument&lt;br&gt;
spatially, moving claims around a desk…&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Spatial thinking: this is exactly what the canvas is for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;supports → C2&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cards get stable IDs (C1, C2…), links are written in both directions, and image excerpts are embedded as data URIs in the downloaded file (and swapped for short placeholders in Copy for AI, so you don't paste megabytes of base64 into a chat box).&lt;/p&gt;

&lt;p&gt;Stack&lt;br&gt;
Deliberately boring: plain HTML, CSS and JavaScript, PDF.js for rendering, IndexedDB for storage, a service worker for offline use, and static hosting on Cloudflare. No framework and no build step. The whole thing is MIT licensed.&lt;/p&gt;

&lt;p&gt;A few things that were harder than expected:&lt;/p&gt;

&lt;p&gt;Pinch-to-zoom on long PDFs. Re-laying out 150 pages on every touch event made it stutter. The fix was to preview the zoom with a cheap CSS transform during the gesture and only commit the real zoom when your fingers lift, re-anchored to the page element under them so it doesn't drift.&lt;br&gt;
Highlights wider than the text. PDF.js sizes text-layer spans with a CSS variable I wasn't setting, so every span fell back to 16px and highlights spilled past the end of the line. It's a one-line fix once you find it.&lt;br&gt;
Dragging cards on a tablet when the finger lands on text. Deciding between "scroll this long quote" and "drag this card" needed a small gesture classifier: wait 6px, then look at direction and whether the quote can actually scroll.&lt;br&gt;
Try it&lt;br&gt;
Try it with the sample PDF (no file needed): &lt;a href="https://marginalianotes.app/app/?sample=1" rel="noopener noreferrer"&gt;https://marginalianotes.app/app/?sample=1&lt;/a&gt;&lt;br&gt;
The app: &lt;a href="https://marginalianotes.app" rel="noopener noreferrer"&gt;https://marginalianotes.app&lt;/a&gt;&lt;br&gt;
Code (MIT): &lt;a href="https://github.com/dikshantraj09/marginalia" rel="noopener noreferrer"&gt;https://github.com/dikshantraj09/marginalia&lt;/a&gt;&lt;br&gt;
Product Hunt: &lt;a href="https://www.producthunt.com/products/marginalia-3" rel="noopener noreferrer"&gt;https://www.producthunt.com/products/marginalia-3&lt;/a&gt;&lt;br&gt;
I'd love feedback, especially from people who read a lot of papers or long documents. What would make you actually switch from highlights?&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>opensource</category>
      <category>productivity</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
