Skip to main content

render_pdf

Function render_pdf 

Source
pub fn render_pdf(
    scene: &Scene,
    fonts: &dyn FontProvider,
    assets: &dyn AssetProvider,
) -> Vec<u8> 
Expand description

Render scene to a deterministic vector PDF (a single page).

fonts resolves glyph outlines for any DrawGlyphRun; assets resolves raster bytes for any DrawImage. The output carries print box metadata (MediaBox / TrimBox / BleedBox / CropBox) and native DeviceCMYK colors for CMYK-origin tokens. Identical input yields byte-identical output: no timestamps, no document id, ordered iteration throughout.

Mirrors the shape of crate::render_png (scene, fonts, assets).

This is a thin single-page wrapper over render_pdf_multi; the one-scene path through that function yields byte-identical output to a historical single-page implementation (catalog=1, pages=2, page=3, content=4, resources from 5).