Skip to main content

Module docx_options

Module docx_options 

Source
Expand description

Page geometry + base typography for DOCX export.

TextDocument::to_docx writes with docx-rs’s built-in defaults (US-Letter, the default font, single-spaced, 1“ margins). DocxExportOptions lets a caller override that with a manuscript style: page size, margins, body font, line spacing, first-line indent, paragraph spacing, alignment, and an optional page-number header. Everything is in DOCX units — twips (1/1440 inch) for lengths, half-points for the font size — so this crate stays free of any point/inch or preset semantics; the caller (e.g. skribisto’s compiler) does the conversion.

Per-block RTL is not an option here: it is read from each block’s own fmt_direction (set on the model) and emitted as a paragraph-level <w:bidi/>. A document that mixes LTR and RTL scenes is therefore handled per paragraph, independently of these options.

Structs§

DocxExportOptions
Page geometry + base typography overrides for a DOCX export. Every field is optional; the Default is “no overrides” — exactly what plain to_docx produces.