Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Format Conversion

Rust API

#![allow(unused)]
fn main() {
use s1engine::{Engine, Format};

let engine = Engine::new();
let doc = engine.open(&std::fs::read("input.docx")?)?;

// Convert to any supported format
std::fs::write("output.odt", doc.export(Format::Odt)?)?;
std::fs::write("output.pdf", doc.export(Format::Pdf)?)?;
std::fs::write("output.txt", doc.export(Format::Txt)?)?;
std::fs::write("output.md", doc.export(Format::Md)?)?;
}

Server API

curl -X POST http://localhost:8080/api/v1/convert \
  -F file=@input.docx \
  -F format=pdf \
  -o output.pdf

Supported Conversions

FromDOCXODTPDFTXTMD
DOCX-YesYesYesYes
ODTYes-YesYesYes
TXTYesYesYes-Yes
MDYesYesYesYes-
DOCYesYesYesYesYes

Fidelity Notes

  • DOCX ↔ ODT: Full formatting round-trip
  • Any → PDF: Layout engine with font embedding
  • Any → TXT: Text extraction (formatting lost)
  • DOC → Any: Basic text extraction only