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
DEFAULT_RASTER_QUALITY, currently 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§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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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().