pub trait PageDecorator {
// Required method
fn decorate_page<'a>(
&mut self,
context: &Context,
area: Area<'a>,
style: Style,
) -> Result<Area<'a>, Error>;
}Expand description
Prepares a page of a document.
If you set an implementation of this trait for a Document using the
set_page_decorator method, its decorate_page method is called every time a new page
is added to the document. The decorator can prepare the page before it is filled with the
actual content. See SimplePageDecorator for a basic implementation.
Required Methods§
Sourcefn decorate_page<'a>(
&mut self,
context: &Context,
area: Area<'a>,
style: Style,
) -> Result<Area<'a>, Error>
fn decorate_page<'a>( &mut self, context: &Context, area: Area<'a>, style: Style, ) -> Result<Area<'a>, Error>
Prepares the page with the given area before it is filled with the document content and returns the writable area of the page.
The returned area will be passed to the document content.