Built 35 PDF tools that mostly run entirely in the browser learned a lot about client-side PDF processing
I recently built HugMyPDF and wanted to share some implementation details because PDF handling in browsers turned out to be more interesting than I expected.
Most free tools run fully client-side:
- pdf-lib handles merge/split/rotate/protect/watermark
- PDF.js handles rendering + text extraction
- Files processed as ArrayBuffers inside Web Workers
- No fetch() calls during processing
- Downloads generated using Blob URLs
A few things I learned:
- Moving PDF work into Web Workers massively improved UI responsiveness
- Avoiding string conversion reduced memory spikes on larger files
- Mobile Chrome has weird Blob preview limitations for generated PDFs
- OCR on multi-page scans became much harder than expected
For Pro features I used:
- FastAPI (Python 3.12)
- LibreOffice headless conversions
- Tesseract OCR
- GPT-4 for AI summarize/chat
Infra is surprisingly small:
- Cloudflare Pages
- $6 DigitalOcean VPS
- Cloudflare Workers for Stripe webhooks
- Resend for emails
Biggest pain point so far:
LibreOffice conversion consistency across complex layouts.
Curious how others here handle:
- large-file processing in-browser
- OCR pipelines
- async job queues for conversions