Silurus/ooxml: Pixel-faithful Office documents, rendered in the browser
TL;DR Highlight
A Rust+WASM Office viewer on Canvas, built entirely by AI coding agents
Who Should Read
Frontend or backend developers who want in-browser docx, xlsx and pptx previews without server-side LibreOffice conversion
Core Mechanics
- AI agents wrote all the code
- The README says the Rust parsers, TypeScript renderers, tests and tooling were built mainly by Claude and Codex through iterative prompting.
- It states that no human-written application code exists in the repo.
- A spec plus a reference output suits AI
- OOXML has a written spec (ECMA-376 / ISO-29500), and Word, Excel and PowerPoint serve as the correct answer.
- The author limited scope to viewing to avoid the risk of corrupting user files.
- Rust parsers in WASM, Canvas 2D rendering
- Parsers are written in Rust and compiled to WebAssembly.
- Headless engines (DocxDocument, XlsxWorkbook, PptxPresentation) draw into your own canvas so you can build custom UI.
- Scope is strictly read-only
- Editing UI, mutation APIs and save or round-tripping are out of scope.
- Read-only interactions like selection, copy, search and hit testing are in scope.
- Install and usage are simple
- Run npm install @silurus/ooxml, import DocxViewer, XlsxViewer or PptxViewer, and call load().
- Math (MathJax, ~4MB), ChartEx, 3D charts and TIFF are opt-in modules kept out of the bundle unless imported.
- Selection context for AI/MCP requests
- xlsx.getSelectionContext() returns the selected cells in a serializable read-only form.
- You can cap it with maxCells and maxTextCharacters.
Community Reactions
- Experiences of heavy mismatches on complex files
- One commenter tried medium-complex documents and found rendering wildly wrong.
- Another said it failed on all their internal test files.
- Objections about PPTX gaps
- One commenter said slide image backgrounds and bullet images do not work and some text colors are inverted.
- They also noted the repo itself doesn't claim pixel-faithful rendering.
- XLSX preview impressed one commenter
- A commenter who used server-side headless LibreOffice to PDF said it beats this for PPTX and DOCX.
- They noted this library lacks selectable text, which PDF conversion has.
- They said the XLSX preview, even interactive, blew their mind.
- Bundle sizes and alternatives mentioned
- One commenter measured WASM at docx 458kb (217kb gzip), pptx 574kb (253kb) and xlsx 601kb (269kb).
- Similar projects eigenpal/docx-editor and superdoc-dev/superdoc were mentioned.
How to Apply
- Compare rendering on your own files first
- Today, upload 5 to 10 real docx, pptx and xlsx files from your service to the demo (ooxml.silurus.dev) and compare against Office.
- Check backgrounds, bullets and tables, which commenters flagged.
- Plug the Canvas viewer into your preview feature
- Where you use server PDF conversion, use DocxViewer, XlsxViewer or PptxViewer and pass the file URL to load().
- Keep PDF conversion for screens that require text selection.
- Pass XLSX selection to AI requests
- When a user selects cells, serialize them with getSelectionContext({maxCells}) and put the result in an LLM prompt or MCP request.
- Use maxCells and maxTextCharacters to cap token usage.
- Check bundler and WASM path settings
- On the Vite 7 dev server, add optimizeDeps.exclude for '@silurus/ooxml' in vite.config.
- For esbuild or Angular CLI, copy the .wasm and set the wasmUrl option.
Try It
// In your browser project terminal: npm install @silurus/ooxml
// TypeScript below. Replace the canvas id and file path
import { DocxViewer } from '@silurus/ooxml/docx';
const canvas = document.getElementById('docx-canvas') as HTMLCanvasElement;
const docx = new DocxViewer(canvas);
await docx.load('/document.docx');
docx.nextPage();Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques