Expand description
§rdocx-layout
rdocx-layout converts an assembled Word LayoutInput into positioned page
frames. It owns DOCX style resolution, line breaking, table layout, and
pagination.
§Use it when
Use layout_document_deterministic for reproducible output with bundled fonts.
Applications that start from a DOCX file should normally call the rendering
methods on rdocx::Document instead.
§Relationship
This crate converts Word-specific semantic input into the shared positioned
model from oxml-layout. PDF and raster backends consume that model.
§Example
use rdocx_layout::{LayoutInput, Result, layout_document_deterministic};
fn page_count(input: &LayoutInput) -> Result<usize> {
Ok(layout_document_deterministic(input)?.pages.len())
}[dependencies]
rdocx-layout = "0.12.0"Re-exports§
pub use input::ImageData;pub use input::LayoutInput;pub use input::MediaRegistry;pub use input::RevisionView;
Modules§
- block
- Block-level layout: paragraphs and tables as positioned blocks.
- engine
- Layout engine orchestrator: ties all phases together.
- input
- Input types for the layout engine.
- notes
- Footnote and endnote content, laid out once before pagination.
- paginator
- Pagination: distribute blocks across pages with constraints.
- style_
resolver - Style resolution: cascade styles and generate numbering markers.
- table
- Table layout: column widths, cell content, merge handling.
Structs§
- Color
- An RGBA color with components in [0.0, 1.0].
- Document
Metadata - Document metadata to pass through to PDF output.
- Font
Data - Font data for embedding in PDF output.
- Font
File - Font data provided by the user or extracted from an OOXML file.
- FontId
- Opaque font identifier assigned by FontManager.
- Glyph
Run - A positioned run of shaped glyphs.
- Layout
Result - The complete result of laying out a document.
- Page
Frame - A single page of laid-out content.
- Point
- A point in 2D space (in typographic points from the top-left corner).
- Rect
- An axis-aligned rectangle.
- Source
Node Id - Result-local identity of one format-specific source node.
- Source
Span - Exclusive Unicode-scalar range within one source node.
- Word
Layout Result - Complete layout output plus its result-local Word source map.
- Word
Source Path - Modeled path to one paragraph in a Word story.
Enums§
- Layout
Error - Positioned
Element - A positioned element on a page.
- Word
Story - Word story containing a source paragraph.
Functions§
- layout_
document - Lay out a complete DOCX document, producing positioned page frames.
- layout_
document_ deterministic - Lay out a DOCX using bundled fonts without system font discovery.
- layout_
document_ deterministic_ with_ provenance - Lay out a DOCX deterministically and retain exact Word paragraph provenance.
- layout_
document_ with_ provenance - Lay out a complete DOCX and retain exact Word paragraph provenance.