Skip to main content

render_html_reflow

Function render_html_reflow 

Source
pub fn render_html_reflow(
    source: Option<&[VertBox]>,
    geometry: &PageGeometry,
    images: &[ImageResource],
    extras: &DocExtras,
    links: &[(DecoId, AnnotAction)],
    dests: &[(DecoId, String)],
) -> Result<String, HtmlError>
Expand description

Serialize the pre-page-break Vec<VertBox> (sourceDocumentValue::reflow_source, None when unavailable, e.g. a hand-built DocumentValue in a test) to a single, self-contained, REFLOWABLE HTML document, leaving every run’s face to the stylesheet’s own generic stack — the base-14 twin of render_html_reflow_ttf_with, exactly mirroring rustyfi_pdf::render_pdf_with’s relationship to rustyfi_pdf::render_pdf_ttf_with.

images is read for real: each Image box resolves against it and becomes an <img> data URI (crate::image::data_uri). extras is accepted mostly for argument-for-argument symmetry with the PDF writer — extras.outline drives heading promotion (Ctx::outline_by_dest), but its annotations/destinations are superseded here by the more precise links/dests slices (DocumentValue::reflow_links/reflow_destsDecoId-keyed, not page-absolute rects; see Ctx::links’s doc comment on why).