pub struct MasterPage {
pub name: String,
pub display_name: Option<String>,
pub page_size: Option<PageSize>,
pub orientation: Option<Orientation>,
pub margins: Option<Margins>,
pub header: Option<MasterPageRegion>,
pub footer: Option<MasterPageRegion>,
pub background_elements: Vec<MasterPageElement>,
pub foreground_elements: Vec<MasterPageElement>,
pub placeholders: HashMap<String, PlaceholderDefinition>,
pub based_on: Option<String>,
}Expand description
A master page template that can be applied to document pages.
Master pages define reusable layouts including headers, footers, background elements, and placeholders for dynamic content.
Fields§
§name: StringUnique identifier for this master page.
display_name: Option<String>Human-readable display name.
page_size: Option<PageSize>Page size (overrides document default if specified).
orientation: Option<Orientation>Page orientation (overrides document default if specified).
margins: Option<Margins>Page margins.
header: Option<MasterPageRegion>Header region definition.
Footer region definition.
background_elements: Vec<MasterPageElement>Background elements (rendered behind content).
foreground_elements: Vec<MasterPageElement>Foreground elements (rendered above content).
placeholders: HashMap<String, PlaceholderDefinition>Placeholders for dynamic content insertion.
based_on: Option<String>Parent master page to inherit from.
Implementations§
Source§impl MasterPage
impl MasterPage
Sourcepub fn with_display_name(self, name: impl Into<String>) -> Self
pub fn with_display_name(self, name: impl Into<String>) -> Self
Set the display name.
Sourcepub fn with_page_size(self, size: PageSize) -> Self
pub fn with_page_size(self, size: PageSize) -> Self
Set the page size.
Sourcepub fn with_orientation(self, orientation: Orientation) -> Self
pub fn with_orientation(self, orientation: Orientation) -> Self
Set the page orientation.
Sourcepub fn with_margins(self, margins: Margins) -> Self
pub fn with_margins(self, margins: Margins) -> Self
Set the margins.
Sourcepub fn with_header(self, content: impl Into<String>) -> Self
pub fn with_header(self, content: impl Into<String>) -> Self
Add a simple text header.
Sourcepub fn with_header_region(self, region: MasterPageRegion) -> Self
pub fn with_header_region(self, region: MasterPageRegion) -> Self
Add a header region.
Add a simple text footer.
Add a footer region.
Sourcepub fn with_background_element(self, element: MasterPageElement) -> Self
pub fn with_background_element(self, element: MasterPageElement) -> Self
Add a background element.
Sourcepub fn with_foreground_element(self, element: MasterPageElement) -> Self
pub fn with_foreground_element(self, element: MasterPageElement) -> Self
Add a foreground element.
Sourcepub fn default_master() -> Self
pub fn default_master() -> Self
Create a standard “default” master page.
Sourcepub fn title_page() -> Self
pub fn title_page() -> Self
Create a master page for title/cover pages.
Trait Implementations§
Source§impl Clone for MasterPage
impl Clone for MasterPage
Source§fn clone(&self) -> MasterPage
fn clone(&self) -> MasterPage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more