Skip to content
BryanBradfoPublic

About

πŸ“„ Blazing-fast Rust/WASM PDF editor to split and format files locally in your browser

Topics

Resources

Contributing

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

477 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ¦— MantisPDF

MantisPDF

CI Deployment MIT License

mantispdf.vercel.app

MantisPDF is a free, open-source PDF toolkit that runs entirely in your browser: 27 tools, from merging and compressing to editing, filling forms, true redaction and OCR. Every file is processed on your device by a Rust engine compiled to WebAssembly. Nothing is uploaded.


Why MantisPDF?

Most online PDF tools (iLovePDF, Smallpdf, ...) upload your files to their servers. MantisPDF does not.

  • No uploads. Your PDFs never leave your device. Every request stays on the app's own origin, including the OCR engine and its language data, and the end-to-end tests check it.
  • No account. Open the page and use it, online or as a desktop app.
  • Fast. PDF work runs in a Web Worker, so the interface stays responsive on large files.
  • Open source. MIT licensed: audit it, fork it, self-host it.

The hosted site uses Vercel's cookieless page-view analytics. Your documents are never part of it.

Tools

Organize Optimize and convert Edit and annotate Security
Split PDF Compress PDF Edit PDF (text, images, shapes, drawings) Encrypt PDF
Merge PDF PDF to Images Fill PDF form (editable or flattened) Unlock PDF
Organize PDF Images to PDF Sign PDF Redact PDF (true removal)
Rotate Pages Extract Images Watermark PDF Sanitize PDF
Remove Pages OCR PDF (searchable scans) Page Numbers Remove Metadata
Extract Pages Crop PDF Header & Footer Edit Metadata
Resize Pages Bates Numbering
N-up Pages

A few that go further than most online tools:

  • Redact PDF removes the text, image pixels and drawings under each mark, then checks the result and refuses to deliver it if anything marked is still there. Pages it cannot guarantee are converted to images, and it tells you which ones.
  • OCR PDF adds an invisible, searchable text layer to scans, in 7 languages, with automatic deskew.
  • Fill PDF form handles text, checkboxes, radio buttons and lists, and never stores password fields.

Tech stack

Layer Technology
Interface React 19, TypeScript (strict), Tailwind CSS, Vite 6
PDF engine Rust with lopdf, compiled to WebAssembly with wasm-pack, run in a Web Worker
Rendering pdf.js (react-pdf) for previews and thumbnails
OCR tesseract.js 7, self-hosted under /ocr-runtime/
Downloads fflate for ZIP archives
Desktop Tauri 2

Getting started

Requirements: Node.js 22+, the Rust toolchain with the wasm32-unknown-unknown target, and wasm-pack (cargo install wasm-pack).

git clone https://github.com/BryanBradfo/mantispdf.git
cd mantispdf
npm ci
npm run build:wasm   # builds the Rust engine into crates/mantis-wasm/pkg
npm run dev          # http://localhost:5173

To try the production build, which is what the end-to-end tests use:

npm run build && npm run preview

Tests

cd crates/mantis-wasm && cargo test   # Rust engine
npm test                              # unit tests (Vitest)
npm run build && npm run test:e2e     # end-to-end in Chromium (needs poppler-utils)

Project structure

mantispdf/
β”œβ”€β”€ crates/mantis-wasm/   Rust engine (split, merge, stamps, forms, redaction, OCR text layer, ...)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/            one page per tool
β”‚   β”œβ”€β”€ components/       UI components, grouped by tool, plus shared ones in common/
β”‚   β”œβ”€β”€ hooks/            usePdfWorker and per-tool state
β”‚   β”œβ”€β”€ workers/          pdf.worker.ts: loads the engine and runs operations off the main thread
β”‚   └── lib/              worker protocol, thumbnails, editor, forms, redaction and OCR logic
β”œβ”€β”€ e2e/                  Playwright tests and their fixtures
β”œβ”€β”€ scripts/              build helpers and fixture generators
└── src-tauri/            desktop app

How it works

  1. You drop a PDF. It is read in the browser.
  2. You choose the tool's options.
  3. The bytes go to a Web Worker, which calls the Rust engine compiled to WebAssembly.
  4. The result comes back to the page and is saved as a file or a ZIP.

Contributing

Contributions are welcome. Read CONTRIBUTING.md, then open a pull request against main from a feature/<name> branch. CI must pass, and Vercel posts a preview link for every pull request. Ideas and bug reports go to Discussions or Issues.

License

MIT

Star History

Star History Chart

About

πŸ“„ Blazing-fast Rust/WASM PDF editor to split and format files locally in your browser

Topics

Resources

Contributing

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages