pub struct PageTemplate {
pub margin_boxes: BTreeMap<MarginBoxPosition, MarginBoxContent>,
pub margins: PageMargins,
pub named_strings: BTreeMap<String, String>,
pub running_elements: BTreeMap<String, RunningElement>,
}Expand description
Full page template with all 16 margin boxes (CSS GCPM @page support).
This provides complete control over page layout following the CSS Paged Media and GCPM specifications.
Fields§
§margin_boxes: BTreeMap<MarginBoxPosition, MarginBoxContent>Content for each margin box position
margins: PageMarginsPage margins (space allocated for margin boxes)
named_strings: BTreeMap<String, String>Named strings captured from the document
running_elements: BTreeMap<String, RunningElement>Running elements available for this page
Implementations§
Source§impl PageTemplate
impl PageTemplate
Sourcepub fn set_margin_box(
&mut self,
position: MarginBoxPosition,
content: MarginBoxContent,
)
pub fn set_margin_box( &mut self, position: MarginBoxPosition, content: MarginBoxContent, )
Set content for a specific margin box.
Sourcepub fn with_centered_page_numbers() -> Self
pub fn with_centered_page_numbers() -> Self
Create a simple template with centered page numbers in the footer.
Sourcepub fn with_page_x_of_y() -> Self
pub fn with_page_x_of_y() -> Self
Create a template with “Page X of Y” in the bottom right.
Trait Implementations§
Source§impl Clone for PageTemplate
impl Clone for PageTemplate
Source§fn clone(&self) -> PageTemplate
fn clone(&self) -> PageTemplate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PageTemplate
impl Debug for PageTemplate
Source§impl Default for PageTemplate
impl Default for PageTemplate
Source§fn default() -> PageTemplate
fn default() -> PageTemplate
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PageTemplate
impl !RefUnwindSafe for PageTemplate
impl Send for PageTemplate
impl Sync for PageTemplate
impl Unpin for PageTemplate
impl UnsafeUnpin for PageTemplate
impl !UnwindSafe for PageTemplate
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
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>
Converts
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>
Converts
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