pub struct PageLayout {
pub margin: usize,
pub text_align: TextAlign,
pub paragraph_spacing: usize,
}Expand description
Page layout configuration
Defines the layout properties for pages in the document, including margins, text alignment, and paragraph spacing.
Fields§
§margin: usizeThe page margin (default: 20, unit: pixels)
Controls the space around the content area on each page.
text_align: TextAlignThe text alignment mode (default: TextAlign::Left)
Controls how text is aligned within the content area.
paragraph_spacing: usizeThe spacing between paragraphs (default: 16, unit: pixels)
Controls the vertical space between block-level elements.
Implementations§
Source§impl PageLayout
impl PageLayout
Sourcepub fn with_margin(&mut self, margin: usize) -> &mut Self
pub fn with_margin(&mut self, margin: usize) -> &mut Self
Sets the page margin
Sourcepub fn with_text_align(&mut self, text_align: TextAlign) -> &mut Self
pub fn with_text_align(&mut self, text_align: TextAlign) -> &mut Self
Sets the text alignment
Sourcepub fn with_paragraph_spacing(&mut self, paragraph_spacing: usize) -> &mut Self
pub fn with_paragraph_spacing(&mut self, paragraph_spacing: usize) -> &mut Self
Sets the paragraph spacing
Trait Implementations§
Source§impl Clone for PageLayout
impl Clone for PageLayout
Source§fn clone(&self) -> PageLayout
fn clone(&self) -> PageLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PageLayout
impl Debug for PageLayout
Auto Trait Implementations§
impl Freeze for PageLayout
impl RefUnwindSafe for PageLayout
impl Send for PageLayout
impl Sync for PageLayout
impl Unpin for PageLayout
impl UnsafeUnpin for PageLayout
impl UnwindSafe for PageLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more