pub struct PdfBuilder<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j> {
inner: Weak<Page>,
args: PdfArgs<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j>,
}Fields§
§inner: Weak<Page>§args: PdfArgs<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j>Implementations§
Source§impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j> PdfBuilder<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j>
impl<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j> PdfBuilder<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j>
pub(crate) fn new(inner: Weak<Impl>) -> Self
pub async fn pdf(self) -> Result<(), Arc<Error>>
Sourcepub fn scale(self, x: f64) -> Self
pub fn scale(self, x: f64) -> Self
Scale of the webpage rendering. Defaults to 1. Scale amount must be between 0.1 and 2.
Display header and footer. Defaults to false.
Sourcepub fn header_template(self, x: &'a str) -> Self
pub fn header_template(self, x: &'a str) -> Self
HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:
'date'formatted print date'title'document title'url'document location'pageNumber'current page number'totalPages'total pages in the document
HTML template for the print footer. Should use the same format as the headerTemplate.
Sourcepub fn print_background(self, x: bool) -> Self
pub fn print_background(self, x: bool) -> Self
Print background graphics. Defaults to false.
Sourcepub fn page_ranges(self, x: &'c str) -> Self
pub fn page_ranges(self, x: &'c str) -> Self
Paper ranges to print, e.g., ‘1-5, 8, 11-13’. Defaults to the empty string, which means print all pages.
Sourcepub fn format(self, x: &'d str) -> Self
pub fn format(self, x: &'d str) -> Self
Paper format. If set, takes priority over width or height options. Defaults to ‘Letter’.
Sourcepub fn prefer_css_page_size(self, x: bool) -> Self
pub fn prefer_css_page_size(self, x: bool) -> Self
Give any CSS @page size declared in the page priority over what is declared in width and height or format
options. Defaults to false, which will scale the content to fit the paper size.
Sourcepub fn margin(self, x: PdfMargins<'g, 'h, 'i, 'j>) -> Self
pub fn margin(self, x: PdfMargins<'g, 'h, 'i, 'j>) -> Self
Paper margins, defaults to none.
Sourcepub fn path(self, x: PathBuf) -> Self
pub fn path(self, x: PathBuf) -> Self
The file path to save the PDF to. If path is a relative path, then it is resolved relative to the current working
directory. If no path is provided, the PDF won’t be saved to the disk.