Story · PowerPoint

I put LibreOffice in the browser, and by the evening it was gone

Yesterday a full office suite booted in a browser tab. A few hours later my own JavaScript drew the same slides, with zero differences, 275 times faster.

· 2 min read

Yesterday was a strange day.

In the morning I got LibreOffice running in the browser. There's a build compiled to WebAssembly, and it really works. I wired it into the app so that opening a .pptx gives you a full editor, running entirely in the tab, nothing sent to a server.

It works, sort of

I tested it on a real deck: 49 MB, 30 slides, photos and German text. The engine takes about 6 seconds to boot, then another 4 to 6 seconds to open the file. And then there it is: Impress, inside a web page, showing the real slides.

Getting there had three traps that each just gave me a blank canvas and no error. My favourite: you have to open the document into a frame called _default. Use _blank, like every example does, and you get a new invisible frame and nothing on screen.

But it felt wrong straight away. It's an app inside an app. A 50 MB download before the first slide. Its own menus, its own look, its own idea of what the slide should look like. And it's still LibreOffice drawing it, the same engine whose PDFs started all this.

Demoting it

So by the afternoon, LibreOffice had a smaller job. I draw the slides myself in normal HTML, and only ask the engine for facts: where is this shape, what colour is this fill, which font does this text use.

Then I started writing my own reader to get those same facts straight from the file's XML. To know if it's right, I wrote a small tool that asks both of them the same questions and compares every answer: position, rotation, fill, insets, anchors, line spacing, text, font, size, colour, bold, italic.

It caught a wrong assumption almost immediately. LibreOffice merges neighbouring pieces of text that share the same formatting, and turns line breaks into fake pieces of text. Of 313 text runs, only 183 line up with what's actually in the file. Anything that edits text using LibreOffice's numbering would edit the wrong words.

Zero differences

By the evening the comparison came back clean. 30 slides, 221 shapes, 198 text runs, zero differences.

So the engine is out of the editor. Everything is now drawn from my own JavaScript. Building all 30 slides takes 404 ms. The engine took 111,697 ms.

404 ms vs 112 s

LibreOffice stays in the project only as a reference to check against, never as code to copy from.

What I'm taking from this

The speed is nice, but the real lesson is the habit: don't assume two things agree, build a tool that checks every field and tells you where they don't. Next step is to stop comparing against LibreOffice and start comparing against PowerPoint itself.