A WebAssembly-powered PDF cropping tool that runs entirely in your browser. No server uploads, 100% private and secure.
Note: This web app lives in the
examples/pdfcrop.github.io/directory of the main pdfcrop Rust project. The build instructions assume this directory structure.
- 🔒 100% Private - All processing happens in your browser via WebAssembly
- 📄 PDF Viewer - View and navigate PDFs with zoom and page thumbnails
- ✂️ Auto-detect - Automatically detect content boundaries using rendering
- 🎯 Manual Selection - Draw custom crop regions per page
- 📏 Flexible Margins - Adjust margins (uniform or per-side)
- 📑 Page Range - Crop all, odd, even, or custom page ranges
- ⚡ Fast - Powered by Rust + WASM
- 🌐 Works Offline - No internet required after initial load
# Build WASM (from parent directory)
cd ../..
cargo install wasm-pack
wasm-pack build --target web --release --out-dir examples/pdfcrop.github.io/pkg
# Return to web app directory
cd examples/pdfcrop.github.io
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run buildVisit http://localhost:8080 to use the app.
- Upload PDF - Drag and drop or select a PDF file
- Auto-detect - Automatically detects content boundaries
- Adjust - Fine-tune margins or draw custom crop regions
- Select Pages - Choose which pages to crop
- Download - Get your cropped PDF instantly
- Frontend: TypeScript + Tailwind CSS
- PDF Rendering: PDF.js
- PDF Processing: Rust
pdfcroplibrary compiled to WASM - Build Tool: Vite
Your PDF never leaves your device. All processing happens locally in your browser using WebAssembly. No server uploads, no tracking, no data collection.
# Development server with hot reload
npm run dev
# Rebuild WASM (after Rust changes)
cd ../.. && wasm-pack build --target web --release --out-dir examples/pdfcrop.github.io/pkg && cd -
# Build for production
npm run build
# Preview production build
npm run preview
# Format code
npm run formatThe web app is automatically deployed to GitHub Pages on every push to the main branch via GitHub Actions.
The deployment workflow:
- Checks out the main
pdfcroprepository - Builds the WASM module using
wasm-pack - Builds the web app with TypeScript and Vite
- Deploys the
distfolder to GitHub Pages
Live Site: https://pdfcrop.github.io
To manually trigger a deployment, use the "Run workflow" button in the Actions tab.
MIT OR Apache-2.0