Struct genpdf::SimplePageDecorator [−][src]
pub struct SimplePageDecorator { /* fields omitted */ }
Expand description
Prepares a page of a document with margins and a header.
Per default, this decorator does not modify the page. If margins have been set with the
set_margins
method, they are applied to every page. If a header callback is configured
with the set_header
method, it will be called for every page and its return value will be
rendered at the beginning of the page (after the margins have been applied).
Implementations
Creates a new page decorator that does not modify the page.
Sets the margins for all pages of this document.
If this method is not called, the full page is used.
pub fn set_header<F, E>(&mut self, cb: F) where
F: Fn(usize) -> E + 'static,
E: Element + 'static,
[src]
pub fn set_header<F, E>(&mut self, cb: F) where
F: Fn(usize) -> E + 'static,
E: Element + 'static,
[src]Sets the header generator for this document.
The given closure will be called once per page. Its argument is the page number (starting with 1), and its return value will be rendered at the top of the page. The document content will start directly after the element.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for SimplePageDecorator
impl !Send for SimplePageDecorator
impl !Sync for SimplePageDecorator
impl Unpin for SimplePageDecorator
impl !UnwindSafe for SimplePageDecorator