<?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: CapDrop</title>
    <description>The latest articles on DEV Community by CapDrop (@capdrop).</description>
    <link>https://dev.to/capdrop</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3967686%2F1171d6af-108b-4ca3-8124-8f7f73ec03ee.png</url>
      <title>DEV Community: CapDrop</title>
      <link>https://dev.to/capdrop</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/capdrop"/>
    <language>en</language>
    <item>
      <title>I built a Windows tool that turns screenshots into one searchable PDF — here's what I learned</title>
      <dc:creator>CapDrop</dc:creator>
      <pubDate>Thu, 04 Jun 2026 06:55:04 +0000</pubDate>
      <link>https://dev.to/capdrop/i-built-a-windows-tool-that-turns-screenshots-into-one-searchable-pdf-heres-what-i-learned-5ch9</link>
      <guid>https://dev.to/capdrop/i-built-a-windows-tool-that-turns-screenshots-into-one-searchable-pdf-heres-what-i-learned-5ch9</guid>
      <description>&lt;p&gt;For months I had the same annoying problem: folders full of screenshots I couldn't actually use. Lecture slides, PDFs I own, scanned pages — all just &lt;strong&gt;images&lt;/strong&gt;. I couldn't Ctrl-F them, couldn't copy a line out, couldn't get my OS to index them. A picture of text is useless the moment you need to find something in it.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;CapDrop&lt;/strong&gt; to automate the whole chain on Windows. This is a write-up of how it works under the hood and the bugs that nearly broke me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea
&lt;/h2&gt;

&lt;p&gt;You draw a capture box over a page, pick a page key (Page Down, arrow keys), set an interval, and walk away. CapDrop then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Captures each page on the interval&lt;/li&gt;
&lt;li&gt;Presses the page key for you to advance&lt;/li&gt;
&lt;li&gt;Auto-crops margins and toolbars out of every shot&lt;/li&gt;
&lt;li&gt;Runs OCR locally&lt;/li&gt;
&lt;li&gt;Binds everything into a single PDF with a real text layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The result is one document you can search, not a pile of images.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Electron&lt;/strong&gt; for the app shell and capture/UI (I already had window management, hotkeys, and floating-bubble export working — no reason to rewrite).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A Python OCR sidecar&lt;/strong&gt; (RapidOCR) spawned as a child process. OCR runs 100% locally; nothing is ever uploaded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;jimp&lt;/strong&gt; for auto-crop, with a 12px safety pad so edge text never gets clipped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pdf-lib&lt;/strong&gt; to bind the pages and inject the OCR text layer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Electron + Python-sidecar split was a deliberate choice. People kept telling me to rewrite the whole thing in Python "for the OCR," but the Electron app already had everything &lt;em&gt;except&lt;/em&gt; OCR. Adding a sidecar was a few hundred lines; a rewrite would've been months.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug that cost me two days
&lt;/h2&gt;

&lt;p&gt;After adding the OCR pipeline, my global capture hotkey developed a &lt;strong&gt;4-second delay&lt;/strong&gt; on the first press. Cold, every time.&lt;/p&gt;

&lt;p&gt;I guessed wrong twice — thumbnail size, then a race condition. Both were dead ends. The only thing that actually found it was instrumenting the hot path with timing logs.&lt;/p&gt;

&lt;p&gt;The culprit: a &lt;code&gt;fs.readFile&lt;/code&gt; of a tiny 749-byte &lt;code&gt;settings.json&lt;/code&gt; on every hotkey press. On a cold start that read was taking &lt;strong&gt;2–4 seconds&lt;/strong&gt; — Windows Defender's real-time scanning + libuv's threadpool warming up. A 749-byte file.&lt;/p&gt;

&lt;p&gt;The fix was to cache settings in memory synchronously so the hot path never touches disk. Instant after that.&lt;/p&gt;

&lt;p&gt;Lesson I keep relearning: &lt;strong&gt;measure, don't guess.&lt;/strong&gt; My two guesses cost me a day each. The timing log found it in ten minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The OCR alignment detail nobody sees
&lt;/h2&gt;

&lt;p&gt;Getting Ctrl-F to &lt;em&gt;highlight the right spot&lt;/em&gt; is harder than getting the text layer to exist. The search works as long as the words are there — but the highlight box only lands correctly if each word's bounding box is positioned right, including font size and baseline descent. I ended up tuning the per-word font size to the box height plus a ~0.18em descent so highlights sit on the word instead of floating above it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I deliberately didn't do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No DRM bypass.&lt;/strong&gt; It's for content you own — your slides, DRM-free PDFs and e-books, your scans. Protected players capture as black frames by design, and I'm not interested in fighting that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No cloud.&lt;/strong&gt; The whole pitch is local. The only network call the app makes is license validation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The boring final boss: code signing
&lt;/h2&gt;

&lt;p&gt;The installer is ~260MB (bundled Python + OCR models), and without code signing Windows SmartScreen throws a scary warning. Signing certs are expensive for a solo dev; registering on the Microsoft Store turns out to be the cheapest path to a trusted signature. Still working through that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it / break it
&lt;/h2&gt;

&lt;p&gt;There's a real searchable sample PDF on the site you can download and Ctrl-F yourself before installing anything: &lt;strong&gt;&lt;a href="https://capdrop.app/?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=buildstory" rel="noopener noreferrer"&gt;capdrop.app&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's Windows-only, $19 one-time with a 7-day trial — but I mostly wrote this up because the debugging stories felt worth sharing. Happy to answer anything about the Electron/Python sidecar split or the OCR pipeline in the comments.&lt;/p&gt;

</description>
      <category>electron</category>
      <category>showdev</category>
      <category>python</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
