Skip to main content

Crate rdocx_layout

Crate rdocx_layout 

Source
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.6"

Re-exports§

pub use input::ImageData;
pub use input::LayoutInput;
pub use input::MediaRegistry;

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].
DocumentMetadata
Document metadata to pass through to PDF output.
FontData
Font data for embedding in PDF output.
FontFile
Font data provided by the user or extracted from an OOXML file.
FontId
Opaque font identifier assigned by FontManager.
GlyphRun
A positioned run of shaped glyphs.
LayoutResult
The complete result of laying out a document.
PageFrame
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.

Enums§

LayoutError
PositionedElement
A positioned element on a page.

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.

Type Aliases§

Result