DEV Community

Muath Aljehani
Muath Aljehani

Posted on

I built a PDF toolkit that never uploads your files — here's how

The Problem

Every time I needed to compress, merge, or convert a PDF, I had to
upload it to some website. Most of them store your file on their
servers for 24+ hours.

For personal documents, contracts, or anything sensitive — that's a
real privacy concern.

The Idea

What if all the processing happened locally in the browser?

Modern JavaScript is powerful enough to handle PDF manipulation
entirely client-side. No file ever needs to leave your device.

What I Built

opdf.io — 27 free PDF tools that run 100% in your browser.

Tools include:

  • Merge, split, compress, rotate
  • PDF → Word, JPG, PNG
  • OCR (works on scanned PDFs, supports Arabic)
  • Sign, protect with password, redact sensitive info
  • Watermark, page numbers, header & footer
  • And more

The Stack

  • React + TypeScript + Vite — frontend framework
  • pdf-lib — PDF creation and manipulation
  • PDF.js — PDF rendering
  • Tesseract.js — in-browser OCR
  • Mammoth — DOCX conversion
  • Cloudflare Pages — hosting and edge delivery

Interesting Challenges

OCR performance: Tesseract.js runs in a Web Worker to avoid
blocking the UI. Large scanned PDFs can take a while — showing
progress without freezing the page took some work.

Bundle size: Initial bundle was 648KB. After splitting
translations into 19 per-language chunks and lazy-loading all
tool pages, it's now 58KB — a 91% reduction.

PDF.js worker: Each page that uses PDF.js needs the worker
configured. Ended up creating a shared pdfjsWorker.ts that
exports the pre-configured library.

What's Next

  • More tools based on user feedback
  • Improve mobile experience
  • Performance improvements for large files

Happy to answer questions about the architecture or any specific
implementation details.

https://opdf.io

Top comments (1)

Collapse
 
gesslar profile image
gesslar

This would be interesting as first-class citizens in a Tauri app. Like my markdown viewer. Too much is online anymore. This is neat though. Gz on the release!