pub struct PdfOptions {Show 13 fields
pub path: Option<PathBuf>,
pub scale: Option<f64>,
pub display_header_footer: Option<bool>,
pub header_template: Option<String>,
pub footer_template: Option<String>,
pub print_background: Option<bool>,
pub landscape: Option<bool>,
pub page_ranges: Option<String>,
pub format: Option<String>,
pub width: Option<String>,
pub height: Option<String>,
pub prefer_css_page_size: Option<bool>,
pub margin: Option<PdfMargin>,
}Expand description
Options for generating a PDF from a page.
Note: PDF generation is only supported by Chromium. Calling page.pdf() on
Firefox or WebKit will result in an error.
Fields§
§path: Option<PathBuf>If specified, the PDF will also be saved to this file path.
scale: Option<f64>Scale of the webpage rendering, between 0.1 and 2 (default 1).
Whether to display header and footer (default false).
header_template: Option<String>HTML template for the print header. Should be valid HTML.
HTML template for the print footer.
print_background: Option<bool>Whether to print background graphics (default false).
landscape: Option<bool>Paper orientation — true for landscape (default false).
page_ranges: Option<String>Paper ranges to print, e.g. "1-5, 8". Defaults to empty string (all pages).
format: Option<String>Paper format, e.g. "Letter" or "A4". Overrides width/height.
width: Option<String>Paper width in CSS units, e.g. "8.5in". Overrides format.
height: Option<String>Paper height in CSS units, e.g. "11in". Overrides format.
prefer_css_page_size: Option<bool>Whether or not to prefer page size as defined by CSS.
margin: Option<PdfMargin>Paper margins, defaulting to none.
Implementations§
Source§impl PdfOptions
impl PdfOptions
Sourcepub fn builder() -> PdfOptionsBuilder
pub fn builder() -> PdfOptionsBuilder
Creates a new builder for PdfOptions
Trait Implementations§
Source§impl Clone for PdfOptions
impl Clone for PdfOptions
Source§fn clone(&self) -> PdfOptions
fn clone(&self) -> PdfOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more