pub struct RenderOptions {
pub dpi: f64,
pub background: [f32; 4],
pub render_annotations: bool,
pub width: Option<u16>,
pub height: Option<u16>,
pub max_pixels: Option<u32>,
pub quality: RasterQuality,
}Expand description
Options for rendering a page.
Fields§
§dpi: f64Resolution in dots per inch (default: 72.0 = 1:1 with PDF points).
background: [f32; 4]Background colour as [r, g, b, a] in 0.0..1.0 (default: opaque white).
render_annotations: boolWhether to render annotations (default: true).
width: Option<u16>Force output width in pixels (overrides DPI for width).
height: Option<u16>Force output height in pixels (overrides DPI for height).
max_pixels: Option<u32>Optional opt-in pixel budget. When Some(n) and the requested scale
would produce more than n pixels (width × height), the effective scale
is reduced proportionally so the output fits the budget. Default None
preserves the exact requested scale (byte-identical to prior behavior).
This is an explicit, caller-controlled quality/performance trade-off — it
is never applied by default and the returned RenderedPage reports the
actual width/height so callers see the applied resolution.
quality: RasterQualityRasterization precision/speed trade-off (default RasterQuality::Quality).
RasterQuality::Quality (default) uses the higher-precision f32
compositing pipeline and is byte-identical to historical output.
RasterQuality::Speed is an explicit opt-in: ~1.4–1.6× faster on
content-heavy pages, with sub-perceptual rounding differences where
blending/anti-aliasing/images compose. Never changes output by default.
Trait Implementations§
Source§impl Clone for RenderOptions
impl Clone for RenderOptions
Source§fn clone(&self) -> RenderOptions
fn clone(&self) -> RenderOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderOptions
impl Debug for RenderOptions
Source§impl Default for RenderOptions
impl Default for RenderOptions
Source§impl From<&RenderConfig> for RenderOptions
impl From<&RenderConfig> for RenderOptions
Source§fn from(cfg: &RenderConfig) -> Self
fn from(cfg: &RenderConfig) -> Self
Auto Trait Implementations§
impl Freeze for RenderOptions
impl RefUnwindSafe for RenderOptions
impl Send for RenderOptions
impl Sync for RenderOptions
impl Unpin for RenderOptions
impl UnsafeUnpin for RenderOptions
impl UnwindSafe for RenderOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().