Skip to main content

render_to_pdf

Function render_to_pdf 

Source
pub fn render_to_pdf(html: &str, config: Config) -> Result<Vec<u8>>
Expand description

Render HTML content to PDF format.

Convenience function that renders directly to PDF without needing to specify the format in the config.

ยงExample

use hyper_render::{render_to_pdf, Config};

let pdf_bytes = render_to_pdf("<h1>Hello</h1>", Config::default())?;
std::fs::write("output.pdf", pdf_bytes)?;