kcode-html-to-pdf 0.1.0

A tiny self-contained HTML/CSS to PDF wrapper around Ironpress
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# kcode-html-to-pdf

A tiny Rust wrapper that renders self-contained HTML/CSS documents to PDF bytes with [Ironpress](https://crates.io/crates/ironpress).

```rust
use kcode_html_to_pdf::{render, Font};

let pdf = render(
    "<!doctype html><html><body><h1>Hello</h1></body></html>",
    vec![],
)?;
# Ok::<(), kcode_html_to_pdf::RenderError>(())
```

Supply custom licensed fonts at runtime as `Font { family, ttf }`. Keep images self-contained as data URLs or inline SVG, and express page geometry and page breaks in CSS. Sanitization remains enabled; remote loading and filesystem base paths are not exposed.

See [Documentation.md](Documentation.md) for the complete contract.