<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ChopPDF Dev]]></title><description><![CDATA[Engineering notes behind ChopPDF (choppdf.com): building 100% client-side, zero-upload browser tools for splitting, extracting, and merging PDFs.]]></description><link>https://choppdf.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6b12c9a1bf70270747fd3054/724e2022-e0b9-4efa-ba3e-634797b267ef.png</url><title>ChopPDF Dev</title><link>https://choppdf.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 19:35:11 GMT</lastBuildDate><atom:link href="https://choppdf.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I Built a Client-Side PDF Splitter With No Uploads]]></title><description><![CDATA[How to split, extract, and merge PDFs 100% client-side in the browser using JavaScript, File.arrayBuffer(), and pdf-lib with zero server uploads.]]></description><link>https://choppdf.hashnode.dev/how-i-built-a-client-side-pdf-splitter-with-no-uploads</link><guid isPermaLink="true">https://choppdf.hashnode.dev/how-i-built-a-client-side-pdf-splitter-with-no-uploads</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[privacy]]></category><category><![CDATA[web apps]]></category><category><![CDATA[pdf]]></category><dc:creator><![CDATA[KattBox]]></dc:creator><pubDate>Fri, 04 Dec 2026 14:21:12 GMT</pubDate><content:encoded><![CDATA[<p>Every time I needed to split a bank statement, extract a few pages from a contract, or merge two PDFs, I ran into the same uncomfortable tradeoff: most popular online PDF tools ask you to upload your files to a remote server first.</p>
<p>Even when a site promises to delete files after an hour, uploading sensitive documents—tax forms, invoices, ID scans, legal agreements—to a third-party server just to split a few pages never felt right. And on top of the privacy concern, server-side processing costs money, which is why most online PDF tools eventually add file size limits, daily quotas, watermarks, or sign-up walls.</p>
<p>So I built <a href="https://choppdf.com">ChopPDF</a>: a free web tool that splits, extracts, and merges PDFs <strong>100% client-side inside your browser</strong>, with zero file uploads.</p>
<h2>Why Client-Side PDF Processing Makes Sense</h2>
<p>Splitting, reordering, and merging PDFs does not require heavy server-side rendering or OCR. At its core, a PDF is a structured container of objects and a page tree. Copying selected page objects into a new PDF document is mostly byte-level manipulation in memory.</p>
<p>Modern browsers already give us everything needed to do this fast and safely on the user's own device:</p>
<ul>
<li><code>File.arrayBuffer()</code> to read local files directly into memory without touching the network</li>
<li>Mature client-side PDF libraries (such as <code>pdf-lib</code>) to parse, copy, and assemble pages in JavaScript</li>
<li><code>Blob</code> and <code>URL.createObjectURL()</code> to trigger instant local downloads</li>
<li>Client-side ZIP packaging when splitting a multi-page document into individual files</li>
</ul>
<h2>How the Local Pipeline Works</h2>
<p>The entire workflow stays inside the browser tab:</p>
<pre><code class="language-javascript">import { PDFDocument } from 'pdf-lib';

// 1. Read the PDF directly from the user's file input (no fetch / upload)
const bytes = await file.arrayBuffer();
const srcDoc = await PDFDocument.load(bytes);

// 2. Create a new PDF containing only the selected 0-based page indices
const selectedIndices = [0, 2, 3];
const outDoc = await PDFDocument.create();
const copiedPages = await outDoc.copyPages(srcDoc, selectedIndices);
copiedPages.forEach((page) =&gt; outDoc.addPage(page));

// 3. Serialize to bytes and trigger a local download
const outBytes = await outDoc.save();
const blob = new Blob([outBytes], { type: 'application/pdf' });
const url = URL.createObjectURL(blob);

const a = document.createElement('a');
a.href = url;
a.download = 'extracted-pages.pdf';
document.body.appendChild(a);
a.click();
a.remove();

// 4. Defer revoking the Blob URL so async downloads finish cleanly in Safari/Firefox
setTimeout(() =&gt; URL.revokeObjectURL(url), 1000);
</code></pre>
<p>When splitting every page of a document into separate numbered PDFs, each page is generated in memory and bundled into a single <code>.zip</code> archive locally so the browser only triggers one clean download instead of spamming dozens of download prompts.</p>
<p>One caveat worth calling out early is encrypted PDFs. Passing <code>PDFDocument.load(bytes, { ignoreEncryption: true })</code> only bypasses metadata-level permission flags (an owner password with no open password). If a document requires an actual user password to open, skipping that flag will not decrypt the content stream—exporting pages will fail or produce blank/corrupted output, so it is much safer to check <code>srcDoc.isEncrypted</code> upfront and show a clear message.</p>
<h2>Practical Lessons Learned</h2>
<ol>
<li><strong>Always clean up object URLs and buffers:</strong> Large scanned PDFs can easily be 50–100 MB. Revoking Blob URLs after download and avoiding duplicate copies of <code>Uint8Array</code> buffers keeps tab memory usage predictable.</li>
<li><strong>Make page selection effortless:</strong> Supporting simple custom ranges when users need to <a href="https://choppdf.com/extract-pages">extract pages from a PDF</a> in a custom order (like <code>4, 1-2</code>)—or <a href="https://choppdf.com/free-pdf-merger">merge PDF files locally</a> without hitting file-count paywalls—covers most real-world document workflows without cluttering the UI.</li>
<li><strong>Zero server compute = sustainable free tool:</strong> Because there is no backend processing queue or storage bill scaling with user files, the tool can stay free without accounts, upload caps, or watermarks—even on locked-down work laptops or Chromebooks where installing desktop software is not an option.</li>
</ol>
<h2>Verify It Yourself</h2>
<p>If you want to test it—or verify that no file data leaves your browser—open Chrome DevTools, switch to the <strong>Network</strong> tab, open ChopPDF, and drop in a PDF (you can even turn off Wi-Fi after loading the page—splitting, extracting, and merging still work completely offline with zero upload requests).</p>
<p>I would love to hear feedback from fellow developers—especially edge cases you have hit with malformed PDFs, non-standard fonts, or huge scanned documents in the browser!</p>
]]></content:encoded></item></channel></rss>