docx-rs 0.4.20

A .docx file writer with Rust/WebAssembly.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use docx_rs::*;

use std::fs::File;
use std::io::{Read, Write};

pub fn main() {
    let mut file = File::open("./hello.docx").unwrap();
    let mut buf = vec![];
    file.read_to_end(&mut buf).unwrap();

    let mut file = File::create("./hello.json").unwrap();
    let res = read_docx(&buf).unwrap().json();
    file.write_all(res.as_bytes()).unwrap();
    file.flush().unwrap();
}