<?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: Liher</title>
    <description>The latest articles on DEV Community by Liher (@liher_0505).</description>
    <link>https://dev.to/liher_0505</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%2F4262933%2Fde7aa333-77b5-4236-9d9b-02dea652caa3.png</url>
      <title>DEV Community: Liher</title>
      <link>https://dev.to/liher_0505</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/liher_0505"/>
    <language>en</language>
    <item>
      <title>Building a PDF toolkit that never uploads your files</title>
      <dc:creator>Liher</dc:creator>
      <pubDate>Tue, 24 Nov 2026 15:03:01 +0000</pubDate>
      <link>https://dev.to/liher_0505/building-a-pdf-toolkit-that-never-uploads-your-files-5ei2</link>
      <guid>https://dev.to/liher_0505/building-a-pdf-toolkit-that-never-uploads-your-files-5ei2</guid>
      <description>&lt;p&gt;Every "free PDF tool" I tried had the same hidden step: your document goes up to a server somewhere, gets processed, comes back. For a tax return or a signed contract, that's a strange trade to make for a merge operation that a laptop could do.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://pdffold.com/?utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;PDFFold&lt;/a&gt; the other way around — all processing happens in the browser, and the file never leaves the machine. Here's what that actually takes, and where the sharp edges are.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's genuinely easy now
&lt;/h2&gt;

&lt;p&gt;The browser platform has quietly caught up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Page operations&lt;/strong&gt; (merge, split, rotate, reorder) with &lt;code&gt;pdf-lib&lt;/code&gt;. It edits the PDF object graph directly — fast, lossless, no rasterization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rendering&lt;/strong&gt; with &lt;code&gt;pdf.js&lt;/code&gt;, which is the same engine Firefox uses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text extraction&lt;/strong&gt; — &lt;code&gt;pdf.js&lt;/code&gt; exposes a text layer with positions, which is enough to rebuild a rough reading order for Markdown export.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of it runs in a worker or the main thread with zero network calls. The File API means you can read a 200 MB file without ever copying it to a server.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's genuinely hard
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Memory kills more tabs than bugs do.&lt;/strong&gt; A 300-page scanned PDF can balloon past 500 MB decoded. Safari is the most aggressive about killing tabs. The fix is boring but necessary: stream pages in chunks, revoke Blob URLs, and explicitly drop ArrayBuffers when a step finishes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. WASM is heavy.&lt;/strong&gt; OCR needs Tesseract — the engine plus one language pack is tens of megabytes. Loading that eagerly would ruin first paint, so it's lazy-loaded per language, with a visible "preparing engine" state so people don't think it froze.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Compression is a trade-off, not a button.&lt;/strong&gt; The reason server-side compressors get 80% reductions is that they can re-encode pages as images. Client-side you can do the same, but the output stops being text-selectable — fine for scans, bad for contracts. Repacking streams, on the other hand, is lossless but often only saves 10–20%. I ended up exposing both and labelling them honestly, because silently destroying a document's text layer is worse than a smaller number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Service workers will serve your old site back to you.&lt;/strong&gt; A precached app shell means returning visitors keep seeing last week's HTML after every deploy. Cache-busting the SW manifest on each release is the difference between "my deploy didn't work" and shipping.&lt;/p&gt;

&lt;h2&gt;
  
  
  How you can verify the claim
&lt;/h2&gt;

&lt;p&gt;Don't take my word for it — this is testable in ten seconds:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open DevTools → Network tab.&lt;/li&gt;
&lt;li&gt;Drop a PDF into any tool.&lt;/li&gt;
&lt;li&gt;Watch the requests.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the only traffic is page assets, the file never left your computer. The same test works on any tool that makes the claim, including mine. (The tools also keep working offline after the first load, which is a decent second check.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this approach doesn't fit
&lt;/h2&gt;

&lt;p&gt;Being honest about limits: client-side processing is wrong for 2 GB CAD exports, batch jobs of thousands of files, or anything needing a server-side API. It shines for the everyday case — the ten-page contract, the scanned receipt, the form someone emailed you at 11pm.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Build the compression story before the long tail of tools. Users expect "50% smaller" and it's the hardest thing to deliver locally.&lt;/li&gt;
&lt;li&gt;Ship the "verify it yourself" explanation on day one, not as an afterthought. Privacy claims are cheap; proof isn't.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm curious what the community thinks: what's the biggest PDF annoyance you'd want solved &lt;strong&gt;locally&lt;/strong&gt;? I'm collecting the ugly ones — scanned forms, rotated pages, 40 MB email attachments — for the next iteration.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I build &lt;a href="https://pdffold.com/?utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;PDFFold&lt;/a&gt;, a free browser-based PDF toolkit — the heavy tools (OCR, PDF→Word, batch) are paid, everything else is free. There's a short &lt;a href="https://pdffold.com/guides?utm_source=devto&amp;amp;utm_medium=article" rel="noopener noreferrer"&gt;guide to merging PDFs without uploading&lt;/a&gt; if you want the practical version.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Drafted with AI assistance, reviewed before publishing.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>showdev</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
