Stop Uploading Sensitive Files to Random Websites: How I Built 27 Browser-Only PDF & Developer Tools
Think about the last time you needed to do a quick utility task at work: Sign a confidential PDF contract or HR form Merge two invoices or delete a blank page from a PDF Decode an authentication JWT token from a
Think about the last time you needed to do a quick utility task at work:
- Sign a confidential PDF contract or HR form
- Merge two invoices or delete a blank page from a PDF
- Decode an authentication JWT token from a staging or production environment
- Compare two large SQL stored procedures before a release
- Convert a JSON API response into C# classes or a CSV spreadsheet
What do most people do? Google "sign pdf online free" or "jwt decoder online", click the first result, and upload their file or paste their sensitive payload into an unknown website.
The problem is obvious once you open Chrome DevTools: almost every "free" online tool uploads your files to a remote backend, caps how many files you can process, stamps watermarks, or forces you to sign up. Even if a site promises "we delete files after 1 hour", your confidential documents, tokens, and source code still left your machine.
Modern web browsers already have enough power — HTML5 Canvas, Web Workers, WebAssembly, and the Web Crypto API — to run all of these tools 100% locally with zero backend.
That realization led me to build AV ToolVerse: a fast, free, privacy-first workbench with 27 developer, PDF, image, and text tools where 0 bytes are ever uploaded to a server (and everything works offline as a Progressive Web App).
In this article, I'll walk through the client-side architecture, five real engineering pitfalls I hit while building the PDF and crypto tools, and how you can verify zero-upload claims on any web app.
The Architecture: Zero Backend, Zero File Uploads
Traditional online tool sites follow a server-roundtrip model:
Browser -> Upload File -> Cloud Server (process & store temporarily) -> Download Link
With a browser-only architecture, the server only delivers static HTML, CSS, and JavaScript bundles — nothing else. All processing happens strictly inside the user's browser memory:
Local File / Text
|
v
File.arrayBuffer() / TextEncoder
|-- pdf.js (Web Worker) --> Canvas page previews, thumbnails & PNG/JPG/WebP export
|-- pdf-lib --> Embed signatures, merge PDFs, extract/delete pages
|-- Web Crypto API --> Hardware-accelerated SHA-1 / SHA-256 / SHA-384 / SHA-512
|-- Tesseract.js --> Local in-browser OCR (Image to Text)
|
v
Blob -> URL.createObjectURL() -> Instant Local Download (0 network requests)
This brings three immediate benefits:
- True privacy: Sensitive contracts, database queries, and JWTs never leave the user's device.
- Instant speed: No upload progress bars, no cold-start queues, and no server timeouts.
- Near-zero hosting cost: The entire 27-tool app is served as static assets behind a CDN — so it can stay free with no paywalls or artificial file limits.
5 Real Engineering Pitfalls (and How to Solve Them)
1. pdf.js Silently Detaches Your ArrayBuffer
When you load a PDF into pdfjs-dist to render page previews, PDF.js transfers the ArrayBuffer into its Web Worker for performance. That transfer detaches the original buffer in the main thread. If you later hand that same buffer to pdf-lib to save the signed or split document, pdf-lib crashes.
The Fix: Always clone the buffer with .slice(0) before passing it to either library:
const originalBytes = await file.arrayBuffer();
// Give PDF.js its own copy so its worker transfer does not detach originalBytes
const pdfJsDoc = await pdfjsLib.getDocument({
data: originalBytes.slice(0),
}).promise;
// Give pdf-lib a clean copy when saving/editing
const pdfDoc = await PDFDocument.load(originalBytes.slice(0), {
ignoreEncryption: true,
});
2. .mjs Worker MIME Type Failures on Nginx & CDNs
Modern versions of pdfjs-dist ship their worker as an ES module (pdf.worker.mjs). On many static servers or CDNs, .mjs is served as application/octet-stream instead of text/javascript, causing the module worker to fail and leaving the PDF preview canvas completely blank.
The Fix: Fetch the worker script once, wrap its source in a Blob with an explicit text/javascript MIME type, and assign that Blob URL to GlobalWorkerOptions.workerSrc:
import * as pdfjsLib from 'pdfjs-dist/legacy/build/pdf.mjs';
let cachedWorkerBlobUrl: string | null = null;
export async function ensurePdfWorkerReady(): Promise<typeof pdfjsLib> {
if (cachedWorkerBlobUrl) {
pdfjsLib.GlobalWorkerOptions.workerSrc = cachedWorkerBlobUrl;
return pdfjsLib;
}
const res = await fetch('/assets/pdf.worker.mjs', { cache: 'no-cache' });
const code = await res.text();
const blob = new Blob([code], { type: 'text/javascript' });
cachedWorkerBlobUrl = URL.createObjectURL(blob);
pdfjsLib.GlobalWorkerOptions.workerSrc = cachedWorkerBlobUrl;
return pdfjsLib;
}
Since adding this helper, PDF rendering in Sign PDF, Split & Extract PDF, and PDF to Image works reliably across every browser, Nginx config, and Service Worker cache.
3. HTML Canvas Coordinates vs. PDF Coordinates
When placing a signature on a PDF page, there is an easy coordinate mismatch:
-
HTML/CSS & Canvas place
(0, 0)at the top-left. -
PDF files (
pdf-lib) place(0, 0)at the bottom-left.
The Fix: Store every signature placement as normalized 0..1 ratios relative to the rendered page canvas, and invert the Y-axis only during final PDF export:
const { width, height } = page.getSize();
const drawWidth = placement.wRatio * width;
const drawHeight = placement.hRatio * height;
const drawX = placement.xRatio * width;
const drawY = height - placement.yRatio * height - drawHeight;
page.drawImage(embeddedSignaturePng, {
x: drawX,
y: drawY,
width: drawWidth,
height: drawHeight,
});
Normalized ratios also enabled a two-step multi-page workflow in Sign PDF: place and resize your signature once across all pages at the same spot, then switch to Adjust per page to move, resize, add, or skip individual pages.
4. Merging & Splitting PDFs in 15 Lines of Client-Side Code
With pdf-lib, combining multiple PDFs in Merge PDF or extracting/deleting pages in Split & Extract PDF runs entirely in memory:
import { PDFDocument } from 'pdf-lib';
async function mergePdfBuffers(buffers: ArrayBuffer[]): Promise<Blob> {
const merged = await PDFDocument.create();
for (const bytes of buffers) {
const src = await PDFDocument.load(bytes.slice(0), { ignoreEncryption: true });
const copiedPages = await merged.copyPages(src, src.getPageIndices());
for (const page of copiedPages) {
merged.addPage(page);
}
}
const outBytes = await merged.save();
return new Blob([outBytes.buffer as ArrayBuffer], { type: 'application/pdf' });
}
5. Local File Checksums With the Native Web Crypto API
Using the browser's built-in crypto.subtle.digest, Hash & File Checksum Generator computes SHA-1, SHA-256, SHA-384, and SHA-512 locally at native speed (alongside a pure-TypeScript MD5 implementation):
async function computeSha256(file: File): Promise<string> {
const buffer = await file.arrayBuffer();
const digest = await crypto.subtle.digest('SHA-256', buffer);
return Array.from(new Uint8Array(digest), b =>
b.toString(16).padStart(2, '0')
).join('');
}
Don't Trust Claims — Verify Them in 5 Seconds
Whenever any online tool claims "100% browser-only / zero uploads", you can verify it yourself:
- Open the tool in Chrome, Edge, or Firefox.
- Press F12 → open the Network tab → click Clear.
- Drop a PDF, paste a JWT, or run a SQL diff.
- Watch the Network tab — if it's genuinely local, 0 requests will appear.
Explore All 27 Browser-Only Tools
Try AV ToolVerse for free — no sign-up, no watermarks, Dark/Light themes, Ctrl+K quick switcher, Full Screen mode, and offline PWA support:
PDF Tools (Zero Uploads)
- Sign PDF — Draw, type, or upload signatures; apply to all pages at once or customize per page
- Merge PDF — Reorder and combine multiple PDFs into one file
- Split & Extract PDF — Visual page thumbnails to extract, delete, or split pages
- PDF to Image — Export PDF pages to PNG, JPEG, or WebP up to 3x resolution
- Image to PDF — Combine multiple photos into a clean PDF
Developer Tools
- Code & SQL Compare / Merge — Side-by-side diff with inline word highlighting & moved-line detection
- JSON Viewer & Tree — Format, validate, minify, sort keys, and inspect trees
- JSON ↔ CSV Converter — Bidirectional RFC-4180 conversion with nested object flattening & table preview
- JSON to C# Class — Generate strongly typed .NET POCO models instantly
- SQL Formatter — Beautify T-SQL, PostgreSQL, and MySQL queries safely
- Regex Tester & Debugger — Live match highlights, capture groups, replace preview & presets
- Hash & File Checksum — MD5, SHA-1, SHA-256, SHA-384, SHA-512 with built-in verifier
- JWT Decoder, Base64, and UUID v4 Generator
Image, Text & Everyday Utilities
- Image Compressor, Image Resizer, Image to Text (Local OCR), and Add Watermark
- Word Counter, Case Converter, Remove Duplicate Lines, and Text Compare
- QR Code Generator, Password Generator, Color Picker, and Timestamp Converter
What Should I Build Next?
I'm actively expanding AV ToolVerse based on what developers and teams avoid uploading to cloud tools. What local-only tool would save you time every week — Compress PDF, YAML ↔ JSON, Cron Expression Explainer, or something else? Drop a comment below!
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.