pub struct DocxExportOptions {Show 14 fields
pub page_width_twips: Option<u32>,
pub page_height_twips: Option<u32>,
pub margin_top_twips: Option<i32>,
pub margin_bottom_twips: Option<i32>,
pub margin_left_twips: Option<i32>,
pub margin_right_twips: Option<i32>,
pub font_family: Option<String>,
pub font_half_points: Option<usize>,
pub line_spacing_twips: Option<i32>,
pub first_line_indent_twips: Option<i32>,
pub paragraph_spacing_after_twips: Option<i32>,
pub justify: bool,
pub page_numbers: bool,
pub running_header: Option<String>,
}Expand description
Page geometry + base typography overrides for a DOCX export. Every field is optional; the
Default is “no overrides” — exactly what plain to_docx produces.
Fields§
§page_width_twips: Option<u32>Page width in twips (1/1440“). None ⇒ docx default. Pair with page_height_twips.
page_height_twips: Option<u32>Page height in twips. None ⇒ docx default.
margin_top_twips: Option<i32>Top page margin in twips. None ⇒ docx default for that edge.
margin_bottom_twips: Option<i32>Bottom page margin in twips.
margin_left_twips: Option<i32>Left page margin in twips.
margin_right_twips: Option<i32>Right page margin in twips.
font_family: Option<String>Base body font family, applied as the document default (ascii + complex-script slots, so
it also covers RTL runs). None ⇒ docx default.
font_half_points: Option<usize>Base body font size in half-points (24 = 12 pt). None ⇒ docx default.
line_spacing_twips: Option<i32>Body line spacing in twips (240 = single, 360 = 1.5×, 480 = double), applied per body
paragraph — headings keep their own style’s spacing. None ⇒ default.
first_line_indent_twips: Option<i32>First-line indent for body paragraphs, in twips. None/0 ⇒ none.
paragraph_spacing_after_twips: Option<i32>Space after each body paragraph, in twips (pt × 20). None/0 ⇒ none.
justify: boolJustify body text; otherwise it is left-aligned (ragged), or right-aligned in an RTL block.
page_numbers: boolEmit a running header carrying the page number (right-aligned) — the manuscript staple.
running_header: Option<String>Optional running-header text shown before the page number (e.g. "Lastname / TITLE").
Only used when page_numbers is set.
Implementations§
Source§impl DocxExportOptions
impl DocxExportOptions
Sourcepub fn plain() -> DocxExportOptions
pub fn plain() -> DocxExportOptions
docx-rs’s built-in defaults — no manuscript styling (what plain to_docx uses).
Trait Implementations§
Source§impl Clone for DocxExportOptions
impl Clone for DocxExportOptions
Source§fn clone(&self) -> DocxExportOptions
fn clone(&self) -> DocxExportOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more