Skip to main content

Crate rust_docx

Crate rust_docx 

Source
Expand description

Native and WebAssembly-compatible Word document parsing, modeling, and serialization.

Re-exports§

pub use bundle::extract_document_assets;
pub use bundle::extract_document_bundle;
pub use bundle::parse_document_bundle;
pub use bundle::DocumentBundle;
pub use bundle::ExtractDocumentBundleOptions;
pub use export::export_document;
pub use export::ContentOverride;
pub use export::ExportOptions;
pub use export::ExportRequest;
pub use export::ExportedDocument;
pub use export::TableFormat;
pub use revision_inlines::revision_inlines;
pub use revision_inlines::InlineChange;
pub use revision_inlines::RevisionInline;
pub use chart::extract_chart_data;
pub use doc::is_doc_format;
pub use doc::parse_doc;
pub use parse::build_doc_model;
pub use parse::build_doc_model_with_options;
pub use review::extract_document_review;
pub use review::DocumentReview;
pub use review::DocumentComment;
pub use review::CommentTarget;
pub use revisions::DocumentRevision;
pub use revisions::ReviewedDocument;
pub use revisions::RevisionKind;
pub use revisions::RevisionProperties;
pub use revisions::RevisionScope;
pub use revisions::WordProperty;
pub use source_graph::document_source_graph;
pub use source_graph::DocumentSourceGraph;
pub use structured::extract_document_blocks;
pub use structured::extract_document_blocks_with_options;
pub use structured::extract_document_blocks_with_revisions;
pub use structured::BlockDetails;
pub use structured::BlockType;
pub use structured::DocumentBlock;
pub use structured::DocumentWord;
pub use structured::ExtractDocumentBlocksOptions;
pub use structured::ParagraphDetails;
pub use structured::ParagraphInline;
pub use structured::SourceRef;
pub use structured::StructuredDocument;
pub use structured::TableCellDetails;
pub use serialize::can_preserve_image_paint_source;
pub use serialize::model_to_document_xml;
pub use serialize::serialize_doc_model;
pub use serialize::serialize_docx;
pub use serialize::try_serialize_doc_model;
pub use serialize::validate_image_paint_bounds;
pub use zip::create_minimal_docx_package;
pub use zip::package_to_bytes;
pub use zip::parse_docx;
pub use model::*;
pub use package::*;

Modules§

bundle
Portable structured extraction with optional assets, charts, and tracked-change spans.
chart
doc
Legacy Word 97-2003 binary .doc parser ([MS-DOC]).
emf
EMF (Enhanced Metafile) to SVG conversion for the supported drawing record subset: window/viewport mapping, paths, solid brushes/pens, positioned Unicode text, solid raster-operation fills, saved device contexts, fill modes, clipping, and opaque bitmap transfers. Records outside the supported set abort the conversion so the caller can fall back to the unsupported-image placeholder instead of rendering something wrong.
export
HTML document export with selectable HTML, Markdown, or CSV tables.
model
package
parse
review
revision_inlines
Ordered inline spans annotated with tracked insertions and deletions.
revisions
serialize
DOCX serialization.
source_graph
structured
table_grid
transport
Out-of-band payloads for large image fields during model deserialization.
xml
XML parsing utilities.
zip

Structs§

ChartCategory
A label at its stored hierarchy level, starting at zero for the leaf level.
ChartData
ChartPoint
Source indices are zero-based. Values retain their original spelling and precision.
ChartSeries
ParseOptions

Functions§

parse_document_blocks
parse_document_blocks_with_options
parse_document_blocks_with_revisions
Parse Word bytes and return current blocks together with their tracked revisions.
parse_document_bytes
Parses either a DOCX (OOXML zip) or a legacy Word 97-2003 binary .doc file, detected by magic bytes, into the same in-memory package shape.