C++ library that translates office documents to HTML
// momentum
// why it's here
- Active: last commit today
- Built almost entirely by one person
- Health 97/100 with only 45 stars
- Around since 2018 and still shipping
- Accepts sponsorship (github)
// how to help
// readme
OpenDocument.core
A C++ library that reads documents and renders them to HTML, and edits and saves the office formats. It is the engine behind OpenDocument Reader on Android and iOS.
#include <odr/html.hpp>
#include <odr/odr.hpp>
#include <iostream>
const odr::DecodedFile file = odr::open("document.odt");
const odr::HtmlService service = odr::html::translate(file, odr::HtmlConfig());
const odr::Html html = service.bring_offline("output-dir");
for (const odr::HtmlPage &page : html.pages()) {
std::cout << page.name << ": " << page.path << '\n';
}
An editable page records the userβs edits as an op log, and
Document::edit replays it onto the file before a save. See the
editing design.