PDF to SVG
I recently developed PDF to SVG, a client-side web app that converts PDFs to SVGs, entirely in the browser. This post gives a quick overview of how I built it.
The Goal:
Offer a privacy-respecting, accessible, and performant alternative to traditional PDF to SVG converters. No server-side processing, no software installations.
The Tech:
MuPDF.js, which is the official WebAssembly port of MuPDF, does the heavy lifting. This allows for efficient PDF parsing and SVG rendering within the browser.
- File Input: The browser's File Handling API lets users select a PDF.
- MuPDF: MuPDF.js (wasm) opens the PDF and renders each page to SVG.
- Display and Download: SVGs are displayed as images on the page and a download button lets users save them.
- Offline: Service Workers enable offline access.
- System Integration: The app integrates with the File Handling API to become a default PDF handler.
Check it out!
Source code: github.com/client-side-apps/pdf-to-svg
Try the app: pdf-to-svg.client-side.app