pub struct PdfBuilder<'a> { /* private fields */ }Expand description
Builder for generating PDFs.
Implementations§
Source§impl<'a> PdfBuilder<'a>
impl<'a> PdfBuilder<'a>
Sourcepub fn format(self, format: PaperFormat) -> Self
pub fn format(self, format: PaperFormat) -> Self
Set the paper format.
Sourcepub fn margin_all(self, top: f64, right: f64, bottom: f64, left: f64) -> Self
pub fn margin_all(self, top: f64, right: f64, bottom: f64, left: f64) -> Self
Set each margin individually (in inches).
Sourcepub fn print_background(self, print_background: bool) -> Self
pub fn print_background(self, print_background: bool) -> Self
Print background graphics.
Sourcepub fn header_template(self, template: impl Into<String>) -> Self
pub fn header_template(self, template: impl Into<String>) -> Self
Set the header template HTML.
The template can use special classes:
date: current datetitle: document titleurl: document URLpageNumber: current page numbertotalPages: total pages
Set the footer template HTML.
Uses the same special classes as the header template.
Sourcepub fn page_ranges(self, ranges: impl Into<String>) -> Self
pub fn page_ranges(self, ranges: impl Into<String>) -> Self
Set page ranges (e.g., “1-5, 8, 11-13”).
Sourcepub fn prefer_css_page_size(self, prefer: bool) -> Self
pub fn prefer_css_page_size(self, prefer: bool) -> Self
Prefer CSS @page size over the specified format.
Trait Implementations§
Source§impl<'a> Clone for PdfBuilder<'a>
impl<'a> Clone for PdfBuilder<'a>
Source§fn clone(&self) -> PdfBuilder<'a>
fn clone(&self) -> PdfBuilder<'a>
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 moreAuto Trait Implementations§
impl<'a> Freeze for PdfBuilder<'a>
impl<'a> !RefUnwindSafe for PdfBuilder<'a>
impl<'a> Send for PdfBuilder<'a>
impl<'a> Sync for PdfBuilder<'a>
impl<'a> Unpin for PdfBuilder<'a>
impl<'a> !UnwindSafe for PdfBuilder<'a>
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