Silurus/ooxml: Pixel-faithful Office documents, rendered in the browser

TL;DR

Silurus/ooxml is a new open-source library that enables rendering Office Open XML documents directly in the browser with pixel accuracy. Built with Rust and WebAssembly, it offers a customizable, high-fidelity viewer for DOCX, XLSX, and PPTX files, supporting equations and complex layouts.

Silurus/ooxml has launched as an open-source library that renders Office Open XML documents directly within web browsers, achieving pixel-perfect fidelity. Developed entirely in Rust and compiled to WebAssembly, it supports DOCX, XLSX, and PPTX formats, offering developers a new way to embed Office document viewers into web applications without relying on external viewers or server-side rendering.

The library includes Rust-based parsers for each Office format, which are compiled to WebAssembly for efficient in-browser execution. It uses the Canvas 2D API for rendering, enabling precise layout and styling. The system also supports rendering equations in DOCX and PPTX files through an optional MathJax + STIX Two Math engine, which can be included or omitted to optimize bundle size.

Developers can instantiate viewers for each format, providing their own HTML canvas elements or containers. The library is modular, allowing tree-shaking of features such as the math engine, and supports complex document features like charts, shapes, and equations. It also includes a headless API for server or automated processing, making it versatile for various use cases.

Why It Matters

This development matters because it enables high-fidelity Office document rendering entirely on the client side, eliminating the need for server-side conversion or external viewers. It opens possibilities for integrating Office document previews into web apps, collaborative platforms, and educational tools with pixel-perfect accuracy and full control over rendering and UI. The open-source nature encourages further customization and innovation in in-browser document handling.

Ultimate Office AdjustaView SUPPLY BASE Desk Reference Display Organizer CL

Ultimate Office AdjustaView SUPPLY BASE Desk Reference Display Organizer CL

  • Desktop Document Organizer: Holds up to 20 letter-size sheets
  • Color-Coded Pockets: Brightly colored or black for quick identification
  • Weighted Supply Base: 12-inch round, scratch-resistant bottom for stability

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Prior to this, most in-browser Office document rendering relied on converting files to HTML or PDF via server-side tools, often sacrificing fidelity or requiring proprietary solutions. Existing JavaScript libraries lacked the pixel-perfect rendering or full feature support, especially for complex layouts and equations. The rise of WebAssembly has enabled more performant in-browser processing, paving the way for projects like Silurus/ooxml.

This project builds on recent advances in Rust-to-WASM compilation and the increasing demand for client-side document handling in web applications, especially as remote work and online collaboration grow.

“Our goal was to create a fully client-side, pixel-accurate renderer for Office documents that can be integrated into any web app without external dependencies.”

— Silurus/ooxml team

Amazon

Pixel-perfect DOCX XLSX PPTX viewer

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It is not yet clear how well the library performs with extremely large or complex documents, or how it handles all edge cases in Office files. Compatibility with newer or heavily customized Office features remains to be tested. Additionally, the long-term stability and community adoption are still developing.

Amazon

WebAssembly Office document rendering tool

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Future developments include expanding support for more Office features, improving performance with larger files, and developing plugins or integrations for popular web frameworks. The team plans to release detailed documentation and encourage community contributions to enhance robustness and feature set.

Amazon

High-fidelity Office file viewer

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Can I use Silurus/ooxml in production applications?

Yes, as an open-source project, it is available for integration into production, but users should test thoroughly for their specific use cases, especially for large or complex documents.

Does it support all Office features like macros or embedded media?

No, the current version focuses on core layout, styling, and equations. Support for macros, embedded media, or advanced features is limited or not yet implemented.

How does it compare to server-side rendering solutions?

Silurus/ooxml provides client-side, pixel-perfect rendering without server dependencies, offering more control and interactivity, but may require more initial setup and testing for complex documents.

Is the math engine required for rendering equations?

Rendering equations is optional; including the math engine increases bundle size (~3 MB) but enables equation rendering. It can be omitted for smaller, faster builds where equations are not needed.

Source: Hacker News

You May Also Like

OVMS: Open source electric vehicle remote monitoring, diagnosis and control

Open Vehicles introduces OVMS, an open source system for remote monitoring, diagnosis, and control of electric vehicles, offering extensive customization and data access.

HBM Ate the Fab

High Bandwidth Memory (HBM) has become the primary driver of global memory shortages, impacting RAM and GPU supply due to its manufacturing complexity and demand.

Re: [PATCH] OOM_pardon, a.k.a. don’t kill my xlock (2004)

A recent patch in the Linux kernel aims to prevent the OOM killer from terminating specific processes, sparking discussions on system stability and resource management.

The Email Scam Red Flags Everyone Should Know

Here’s how to spot email scam red flags everyone should know, starting with the letter “H,” so you can stay protected from fraudsters.