Skip to main content

Crate ooxml_wml

Crate ooxml_wml 

Source
Expand description

WordprocessingML (DOCX) support for the ooxml library.

This crate provides reading and writing of Word documents (.docx files).

§Reading Documents

use ooxml_wml::Document;
use ooxml_wml::ext::{BodyExt, ParagraphExt};

let doc = Document::open("input.docx")?;
for para in doc.body().paragraphs() {
    println!("{}", para.text());
}

§Creating Documents

use ooxml_wml::DocumentBuilder;

let mut builder = DocumentBuilder::new();
builder.add_paragraph("Hello, World!");
builder.save("output.docx")?;

Re-exports§

pub use generated as types;
pub use generated_parsers as parsers;
pub use generated_serializers as serializers;
pub use document::AppProperties;
pub use document::CoreProperties;
pub use document::Document;
pub use document::DocumentSettings;
pub use document::ImageData;
pub use error::Error;
pub use error::ParseContext;
pub use error::Result;
pub use error::position_to_line_col;
pub use writer::AnchoredImage;
pub use writer::CommentBuilder;
pub use writer::DocumentBuilder;
pub use writer::Drawing;
pub use writer::EndnoteBuilder;
pub use writer::FooterBuilder;
pub use writer::FootnoteBuilder;
pub use writer::HeaderBuilder;
pub use writer::HeaderFooterType;
pub use writer::InlineImage;
pub use writer::ListType;
pub use writer::NumberingLevel;
pub use writer::TextBox;
pub use writer::WrapType;
pub use types::ns;

Modules§

convenience
Builder methods on generated types for ergonomic document construction.
document
Word document API.
error
Error types for the ooxml-wml crate.
ext
Extension traits for generated WML types.
generated
Generated types from the ECMA-376 WordprocessingML schema.
generated_parsers
Generated FromXml parsers for all generated types.
generated_serializers
Generated ToXml serializers for all generated types.
writer
Document writing and serialization.

Structs§

MathZone
A math zone (<m:oMath>).
PositionedAttr
An XML attribute with its original position for correct round-trip ordering.
PositionedNode
A raw XML node with its original position for correct round-trip ordering.
RawXmlElement
A raw XML element with its name, attributes, and children preserved.

Enums§

RawXmlNode
A raw XML node that can be preserved during round-trip.