Skip to main content

PageViewOptions

Struct PageViewOptions 

Source
pub struct PageViewOptions<'a> {
    pub paged_js_source: &'a str,
    pub paper: &'a str,
    pub orientation: &'a str,
    pub margin_mm: u8,
    pub show_page_numbers: bool,
    pub wheel_js: &'a str,
    pub columns_per_row: u8,
    pub for_export: bool,
    pub title: &'a str,
    pub standalone_export: bool,
}
Expand description

Options for CSS paged media rendering via paged.js.

Pass this to wrap_preview_html_document_paged to control page layout.

Fields§

§paged_js_source: &'a str

The full source of the paged.js polyfill (usually pagedjs::PAGED_POLYFILL_JS).

§paper: &'a str

CSS paper size: "A4", "Letter", "A3", "A5", "Legal", "B5".

§orientation: &'a str

Page orientation: "portrait" or "landscape".

§margin_mm: u8

Page margin in millimetres.

§show_page_numbers: bool

Whether to inject a @page counter rule so page numbers appear in the margin.

§wheel_js: &'a str

<script> blocks for wheel scaling and scroll-position reporting (bidirectional scroll sync). Pass the combined wheel_js + SCROLL_REPORT_JS string, or "" to disable.

§columns_per_row: u8

Number of page columns to show side-by-side (1-4). Values outside this range are clamped.

§for_export: bool

When true, inject a @media print CSS block that removes paged.js visual decorations (shadows, gaps, desk background) so pages export cleanly to PDF. Set to false for normal preview rendering.

§title: &'a str

Document title for the HTML <title> tag. Pass "" to omit the tag. Used for standalone HTML file exports; leave as "" for live preview.

§standalone_export: bool

When true, the WebView integration JS (scroll-sync signals and page-ready title hooks) is replaced with a minimal opacity-restore callback. Set to true when producing a standalone HTML file; leave false for live preview in the editor WebView.

Auto Trait Implementations§

§

impl<'a> Freeze for PageViewOptions<'a>

§

impl<'a> RefUnwindSafe for PageViewOptions<'a>

§

impl<'a> Send for PageViewOptions<'a>

§

impl<'a> Sync for PageViewOptions<'a>

§

impl<'a> Unpin for PageViewOptions<'a>

§

impl<'a> UnsafeUnpin for PageViewOptions<'a>

§

impl<'a> UnwindSafe for PageViewOptions<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.