2020-02-11 10:01:39 +02:00
|
|
|
use docx_rs::*;
|
2020-10-05 10:19:05 +03:00
|
|
|
|
|
|
|
use std::fs::File;
|
|
|
|
use std::io::{Read, Write};
|
2020-02-11 10:01:39 +02:00
|
|
|
|
|
|
|
pub fn main() {
|
2021-11-25 12:42:06 +02:00
|
|
|
let mut file = File::open("./spacing.docx").unwrap();
|
2020-02-11 10:01:39 +02:00
|
|
|
let mut buf = vec![];
|
|
|
|
file.read_to_end(&mut buf).unwrap();
|
2020-10-05 10:19:05 +03:00
|
|
|
|
|
|
|
let mut file = File::create("./test.json").unwrap();
|
|
|
|
let res = read_docx(&buf).unwrap().json();
|
|
|
|
file.write_all(res.as_bytes()).unwrap();
|
|
|
|
file.flush().unwrap();
|
2020-02-11 10:01:39 +02:00
|
|
|
}
|