Post

PDF Anvil

PDF Anvil is live at pdf-anvil.com. The source code is in a public repo on GitHub (source-available, PolyForm Noncommercial license).

PDF Anvil is a free PDF toolbox. Every operation runs in the browser: merge, split, rotate, organize, compress, edit and sign, protect and unlock, scan to PDF, and image to PDF (and back). Your files never leave your device. There is no upload, no account, and no server processing.

The site is available in 11 languages, including Arabic with right-to-left layout.

Features

  • Browser-only processing — pdf-lib edits the documents and pdfjs-dist renders the pages. The site has no API routes, no database, no accounts, and no file uploads.
  • Password tools on WebAssembly — protect and unlock run qpdf, compiled to WebAssembly, inside a Web Worker. The 2.2 MB module loads only when you first use it.
  • PDF editor and signer — add text, whiteout, highlights, images, and freehand ink. The edits stay upright on rotated pages.
  • Compression — the browser re-encodes the images in a PDF at three levels.
  • Scan to PDF — capture pages with the phone camera.
  • Viewer — renders pages lazily, two at a time, with zoom and print.
  • Page organizer — drag and drop pages; download multi-file results as a ZIP.
  • 11 languages — English, Arabic (RTL), German, Spanish, French, Indonesian, Italian, Japanese, Portuguese, Thai, and Vietnamese, with a language selector and per-language share images.
  • Light and dark theme.

How it is built

  • Registry-driven tools — to add a tool, you add one registry entry, one pure bytes-to-bytes function, and one component built from shared parts (dropzone, file list, page grid, action bar, result panel). The route, metadata, sitemap, header, footer, and related-tool links all come from the registry.
  • Lazy-loaded tools — each tool is a separate client chunk (next/dynamic), so a page loads only the code it needs.
  • i18n framework — one catch-all route, a typed message catalog, hreflang alternates, and a contract test that checks every locale folder. A test also proves that the share-image font covers every character of the copy.
  • Tests — 162 automated test cases across 16 files with Vitest.
  • Deployment — static export, served as Cloudflare Workers static assets through Wrangler.

Summary

A free, private PDF toolbox built with Next.js.

  • 21 tool pages over 11 tool kinds, in 11 languages, with 250 URLs in the live sitemap.
  • All processing in the browser, including qpdf on WebAssembly in a Web Worker.
  • Registry-driven architecture and 162 Vitest test cases.
  • About 27,000 lines of TypeScript, built from 2026-09-02 to 2026-09-12 and live since 2026-09-04.
This post is licensed under CC BY 4.0 by the author.