Wiki › Project
zed-pdf-lsp
Article
ReadAll pages
From Chaipat's knowledge graph
zed-pdf-lsp is a language server, written in Rust, that lets the Zed editor open PDF files. When Zed opens a PDF, the server extracts its text and presents it as readable Markdown.
Features
- Keeps paragraphs and headings, and renders multi-page PDFs page by page.
- Handles corrupted, encrypted and image-only PDFs with clear errors instead of crashing.
- Converts asynchronously, so the editor never freezes, with a 10-second timeout and a 500 MB memory limit per file.
- Logs in a structured format.
How it's built
It is built on tower-lsp for the Language Server Protocol and pdf-extract for reading PDFs, and the code is split into the server, message handling, a document registry and the converter. Besides ordinary tests it uses property-based testing with proptest, which generates random inputs to find edge cases. A GitHub Actions workflow builds and tests it.