PDF to SVG

PDF to SVG icon

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.

  1. File Input: The browser's File Handling API lets users select a PDF.
  2. MuPDF: MuPDF.js (wasm) opens the PDF and renders each page to SVG.
  3. Display and Download: SVGs are displayed as images on the page and a download button lets users save them.
  4. Offline: Service Workers enable offline access.
  5. 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