PDF Sanitizer
Project Overview
PDF Sanitizer is a desktop application that removes potentially dangerous or privacy-leaking content from PDF files — JavaScript, auto-run actions, embedded attachments, outbound links and metadata — and replaces each file with a clean copy. Originals are moved to a backup folder, and every sanitized file is re-parsed and verified before the original is touched.
It ships as a single Windows executable with no installer, no account and no network access: everything runs locally.
Features
- Active Content Removal: Strips JavaScript,
OpenAction/AAtriggers, launch, submit-form and media actions, and XFA forms — wherever they appear in the document. - Hidden Payload Removal: Deletes embedded files and file-attachment annotations.
- Metadata Scrubbing: Removes author, dates, producer software and XMP metadata streams.
- Link Stripping: Optionally removes links to external URLs and remote files while keeping internal navigation.
- Verified Output: Checks page count, content streams and leftover scripts on every result; if a check fails, the original is left untouched.
- Safe File Handling: Originals are moved to a backup folder and the clean file takes their place, with automatic rollback if the swap fails.
- Batch Processing: Process up to 8 files in parallel with per-file progress, stop and retry.
- File Size Optimization: Optional TrueType font subsetting and JPEG image recompression.
- Encrypted PDF Support: Opens files protected only by an owner (permissions) password, including AES-encrypted ones.
- Light & Dark Theme: Follows the system theme.
Tech Stack
Frontend
- Framework: Svelte 5
- Build Tool: Vite
- Testing: Vitest
- Native Dialogs: Tauri Dialog Plugin
Backend
- Desktop Shell: Tauri 2
- Language: Rust
- Async Runtime: Tokio with semaphore-based concurrency and cancellation tokens
- PDF Engine: lopdf in a standalone
pdfsan-corecrate, with custom font subsetting and image recompression
Tooling
- Cross-compilation: cargo-xwin builds the Windows
.exefrom Linux, in Docker and GitHub Actions - CI/CD: GitHub Actions for tests, releases with changelog-driven notes, and a VitePress documentation site on GitHub Pages