Back to projects

// personal project

Personal

Zed PDF Reader

RustZed Extensionpdf.jsWebAssembly

Zed extensions run in a WASM sandbox and cannot render custom UI, so a conventional in-editor PDF viewer is impossible. This project takes the other route: a companion Rust binary runs a local daemon that serves a bundled pdf.js viewer on 127.0.0.1 and opens the PDF in the default browser, giving the full pdf.js feature set — page navigation, text search, zoom, thumbnails, text selection, and print.

The daemon watches every PDF it serves and pushes a reload to the browser tab when the file changes on disk, so a rebuilt LaTeX or Typst document refreshes in about a second. One daemon serves any number of PDFs, one tab each. Invoked with no argument, the CLI scans the working directory and shows a numbered picker sorted newest-first. It works standalone without Zed, and runs on macOS (arm64/x64) and Linux (x64).

Key Highlights

  • Routes around Zed's WASM sandbox with a companion daemon plus browser viewer
  • Full pdf.js feature set: search, zoom, thumbnails, text selection, print
  • Filesystem watcher pushes live reload on rebuild, ideal for LaTeX/Typst
  • One daemon serves any number of PDFs, with ephemeral port fallback
  • Works standalone as a CLI, no Zed required, on macOS and Linux