pub struct PdfOptions {
pub page_format: PageFormat,
pub orientation: PageOrientation,
pub margins: PageMargins,
pub print_background: bool,
pub scale: f64,
pub prefer_css_page_size: bool,
pub custom_width: Option<f64>,
pub custom_height: Option<f64>,
pub timeout_seconds: u64,
pub wait_for_network_idle: bool,
pub additional_wait_ms: u64,
}
Expand description
Options for PDF generation from HTML.
Fields§
§page_format: PageFormat
Page format (e.g., “A4”, “Letter”, “Legal”)
orientation: PageOrientation
Page orientation
margins: PageMargins
Page margins in inches
print_background: bool
Whether to print background graphics
scale: f64
Scale factor for the page (0.1 to 2.0)
prefer_css_page_size: bool
Whether to prefer CSS page size
custom_width: Option<f64>
Custom page width in inches (overrides page_format if set)
custom_height: Option<f64>
Custom page height in inches (overrides page_format if set)
timeout_seconds: u64
Timeout for page loading in seconds
wait_for_network_idle: bool
Whether to wait for network idle before generating PDF
additional_wait_ms: u64
Additional wait time in milliseconds after page load
Trait Implementations§
Source§impl Clone for PdfOptions
impl Clone for PdfOptions
Source§fn clone(&self) -> PdfOptions
fn clone(&self) -> PdfOptions
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 moreSource§impl Debug for PdfOptions
impl Debug for PdfOptions
Source§impl Default for PdfOptions
impl Default for PdfOptions
Source§impl<'de> Deserialize<'de> for PdfOptions
impl<'de> Deserialize<'de> for PdfOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PdfOptions
impl RefUnwindSafe for PdfOptions
impl Send for PdfOptions
impl Sync for PdfOptions
impl Unpin for PdfOptions
impl UnwindSafe for PdfOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more