pub struct PageConfig {
pub size: PageSize,
pub margin: Edges,
pub wrap: bool,
pub background_image: Option<String>,
pub background_opacity: Option<f64>,
pub background_size: Option<BackgroundSize>,
pub background_position: Option<BackgroundPosition>,
pub clip_content_x: bool,
}Expand description
Configuration for a page: size, margins, orientation.
Fields§
§size: PageSizePage size. Defaults to A4.
margin: EdgesPage margins in points (1/72 inch).
wrap: boolWhether this page auto-wraps content that overflows.
background_image: Option<String>Optional background image painted behind the page’s content.
URL, file path, or data:image/...;base64, URI.
background_opacity: Option<f64>Opacity for the background image (0.0–1.0). Defaults to 1.0.
background_size: Option<BackgroundSize>How the background image is sized within the page.
background_position: Option<BackgroundPosition>Where the background image is positioned within the page.
clip_content_x: boolClip page content horizontally to the content box (page width
minus left/right margins). The paged equivalent of a browser
honoring body { overflow-x: hidden }: layout is unaffected,
but ink outside the content box’s x-range never paints — the
off-viewport-parking idiom (right: -230px sidebars) disappears
instead of smearing into the margin. Vertical ink is not clipped.