pub struct HeaderFooterConfig {
pub show_header: bool,
pub show_footer: bool,
pub header_height: f32,
pub footer_height: f32,
pub header_content: MarginBoxContent,
pub footer_content: MarginBoxContent,
pub font_size: f32,
pub text_color: ColorU,
pub skip_first_page: bool,
}Expand description
Configuration for page headers and footers.
This is a simplified interface for the common case of adding
headers and footers. For full GCPM support, use PageTemplate.
Fields§
§show_header: boolWhether to show a header on each page
Whether to show a footer on each page
header_height: f32Height of the header area (if shown)
Height of the footer area (if shown)
header_content: MarginBoxContentContent generator for the header
Content generator for the footer
font_size: f32Font size for header/footer text
text_color: ColorUText color for header/footer
skip_first_page: boolWhether to skip header/footer on first page
Implementations§
Sourcepub fn with_page_numbers() -> Self
pub fn with_page_numbers() -> Self
Create a config with page numbers in the footer.
Create a config with page numbers in both header and footer.
Sourcepub fn with_header_text(self, text: impl Into<String>) -> Self
pub fn with_header_text(self, text: impl Into<String>) -> Self
Set custom header text.
Set custom footer text.
Sourcepub fn generate_content(
&self,
content: &MarginBoxContent,
info: PageInfo,
) -> String
pub fn generate_content( &self, content: &MarginBoxContent, info: PageInfo, ) -> String
Generate the text content for a margin box given page info.
Sourcepub fn header_text(&self, info: PageInfo) -> String
pub fn header_text(&self, info: PageInfo) -> String
Get the header text for a specific page.
Get the footer text for a specific page.
Trait Implementations§
Source§fn clone(&self) -> HeaderFooterConfig
fn clone(&self) -> HeaderFooterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more