pub struct OdtExportOptions {Show 18 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>,
pub heading_styles: Vec<OdtHeadingStyle>,
pub images: ExportImages,
pub comments: DocumentComments,
pub marks: DocumentMarks,
}Expand description
Page geometry + base typography overrides for an ODT export. Every field is optional; the
Default is “no overrides” — a plain “Standard”-styled document at ODF/LibreOffice’s own
built-in page defaults (A4-ish, 2cm-ish margins — whatever the reader substitutes for an
unstyled style:page-layout).
Fields§
§page_width_twips: Option<u32>Page width in twips (1/1440“). None ⇒ no style:page-layout-properties override for
this edge (the reader’s own default page size). Pair with page_height_twips.
page_height_twips: Option<u32>Page height in twips. None ⇒ reader default.
margin_top_twips: Option<i32>Top page margin in twips. None ⇒ reader 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 on the “Standard” paragraph style’s text properties (so
every other named/automatic style that descends from it inherits it, complex-script runs
included — ODF has no separate “ascii vs. complex-script” font slot the way OOXML does;
one style:font-name covers both). None ⇒ reader default.
font_half_points: Option<usize>Base body font size in half-points (24 = 12 pt). None ⇒ reader default.
line_spacing_twips: Option<i32>Body line spacing in twips (240 = single, 360 = 1.5×, 480 = double), applied per body
paragraph as fo:line-height — 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.
Written as a style:master-page’s style:header holding a paragraph with a
<text:page-number> field.
running_header: Option<String>Optional running-header text shown before the page number (e.g. "Lastname / TITLE").
Only used when page_numbers is set.
heading_styles: Vec<OdtHeadingStyle>Definitions for heading levels 1..6, index 0 being level 1. Empty ⇒ the writer falls
back to OdtHeadingStyle::default_ramp over the body size, because the one thing it
must never do is leave every heading looking like undifferentiated body text.
images: ExportImagesBytes for the document’s inline images, keyed by their src.
Supplied by the caller for the same reason super::docx_options::DocxExportOptions::images
is: this crate resolves no paths and reads no files. An image whose src is absent here
is exported as its alt text instead of failing the export — a missing picture must not
cost the writer their manuscript.
comments: DocumentCommentsComment threads to anchor into the exported .odt as real office:annotation ranges —
the ODF analog of super::docx_options::DocxExportOptions::comments. A thread’s
opening note and every reply become their own office:annotation/
office:annotation-end pair (paired by a generated office:name, all sharing the
thread’s own character range — see super::comment_options::DocumentComment’s doc
comment for why a reply carries no range of its own), loext:resolved marks a resolved
thread, and loext:parent-name threads a reply back to its root — the same
LibreOffice-measured spelling document_ingest::sources::odt’s reader already expects
(see M-T2b’s own doc comment in document_io::use_cases::export_odt_uc for the
measurement this was checked against). Empty ⇒ no comments are written, matching plain
to_odt.
Ranges are in the document’s addressable character space — see
super::comment_options::DocumentComment’s doc comment for what that means and why it
is not the same space FormatRun byte offsets live in.
marks: DocumentMarksNamed positions and ranges to anchor into the exported .odt as text:bookmark /
text:bookmark-start+text:bookmark-end — the carrier a host uses to recognise its own
rows and comments when the file comes back from an editor. Empty ⇒ none are written.
Bookmarks and not a private attribute, because a private attribute does not survive: see
super::mark_options’s module doc for the measurement. Same addressable character
space as comments.
Implementations§
Source§impl OdtExportOptions
impl OdtExportOptions
Sourcepub fn plain() -> OdtExportOptions
pub fn plain() -> OdtExportOptions
No overrides — what plain to_odt uses.
Sourcepub fn resolved_heading_styles(&self) -> Vec<OdtHeadingStyle>
pub fn resolved_heading_styles(&self) -> Vec<OdtHeadingStyle>
The heading styles to write, resolved: the caller’s when it gave any, otherwise the default ramp scaled off whatever body size this export uses.
Trait Implementations§
Source§impl Clone for OdtExportOptions
impl Clone for OdtExportOptions
Source§fn clone(&self) -> OdtExportOptions
fn clone(&self) -> OdtExportOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more