pub struct PrintToPDFBuilder { /* private fields */ }Expand description
Builder for PrintToPDF.
Implementations§
Source§impl PrintToPDFBuilder
impl PrintToPDFBuilder
Sourcepub fn landscape<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn landscape<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Paper orientation. Defaults to false.
Display header and footer. Defaults to false.
Sourcepub fn print_background<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn print_background<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Print background graphics. Defaults to false.
Sourcepub fn scale<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn scale<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
Scale of the webpage rendering. Defaults to 1.
Sourcepub fn paper_width<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn paper_width<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
Paper width in inches. Defaults to 8.5 inches.
Sourcepub fn paper_height<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn paper_height<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
Paper height in inches. Defaults to 11 inches.
Sourcepub fn margin_top<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn margin_top<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
Top margin in inches. Defaults to 1cm (~0.4 inches).
Sourcepub fn margin_bottom<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn margin_bottom<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
Bottom margin in inches. Defaults to 1cm (~0.4 inches).
Sourcepub fn margin_left<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn margin_left<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
Left margin in inches. Defaults to 1cm (~0.4 inches).
Sourcepub fn margin_right<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
pub fn margin_right<VALUE: Into<JsFloat>>(&mut self, value: VALUE) -> &mut Self
Right margin in inches. Defaults to 1cm (~0.4 inches).
Sourcepub fn page_ranges<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn page_ranges<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
Paper ranges to print, one based, e.g., ‘1-5, 8, 11-13’. Pages are printed in the document order, not in the order specified, and no more than once. Defaults to empty string, which implies the entire document is printed. The page numbers are quietly capped to actual page count of the document, and ranges beyond the end of the document are ignored. If this results in no pages to print, an error is reported. It is an error to specify a range with start greater than end.
Sourcepub fn header_template<VALUE: Into<String>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn header_template<VALUE: Into<String>>( &mut self, value: VALUE, ) -> &mut 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 datetitle: document titleurl: document locationpageNumber: current page numbertotalPages: total pages in the document
For example, \<span class=title\>\</span\> would generate span containing the title.
HTML template for the print footer. Should use the same format as the headerTemplate.
Sourcepub fn prefer_css_page_size<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn prefer_css_page_size<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
Sourcepub fn transfer_mode<VALUE: Into<PrintToPdfTransferModeOption>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn transfer_mode<VALUE: Into<PrintToPdfTransferModeOption>>( &mut self, value: VALUE, ) -> &mut Self
return as stream
Sourcepub fn generate_tagged_pdf<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn generate_tagged_pdf<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Whether or not to generate tagged (accessible) PDF. Defaults to embedder choice.
Sourcepub fn generate_document_outline<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn generate_document_outline<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Whether or not to embed the document outline into the PDF.
Sourcepub fn build(&self) -> Result<PrintToPDF, PrintToPDFBuilderError>
pub fn build(&self) -> Result<PrintToPDF, PrintToPDFBuilderError>
Trait Implementations§
Source§impl Clone for PrintToPDFBuilder
impl Clone for PrintToPDFBuilder
Source§fn clone(&self) -> PrintToPDFBuilder
fn clone(&self) -> PrintToPDFBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more