Any file in.
Markdown and a viewer out.
One package that reads PDF, Word, PowerPoint, Excel, OpenDocument, EPUB, images, media and more into GitHub-Flavored Markdown, and renders every one of them in your app. The controls are yours to draw. It all runs here in your browser: files never leave your machine.
No document at hand? Try a sample:
About
- One model
- Every format parses into the same document model and renders through the same Markdown serializer, so headings, nested lists, merged table cells, and footnotes come out the same from a .doc written in 2003 as from yesterday's .pptx.
- Rendering
- Every format that parses also renders: PDF through pdf.js, Word and PowerPoint as laid-out pages, every spreadsheet format in one virtualized grid with its styles and charts, and the rest from the document model. Files are untrusted: nothing in them runs or reaches the network.
- Headless
- The viewer draws the document and nothing else. Pages, zoom, search and sheets come out as state and actions, so the controls above are this page's own: about forty lines of script.
- Detection
- The format is read from the bytes, not the extension, so mislabeled files still convert.
- Speed
- Pure Rust, no ML models, no services: median conversion is under 5 ms. Of seven converters benchmarked on 100 documents, anydoc was the only one to handle all fourteen formats.
- Text-based PDFs convert locally through pdf-inspector. Scanned pages need OCR, which Firecrawl Parse adds on top of this same conversion.
- This page
- Everything above is @glass-hq/documents. Drop it into your own app the same way.
Install
- Browser
-
$
npm install @glass-hq/documents
Call toMarkdown(file) for Markdown, or
createViewer(element, file) to show it. See the
README.