Skip to content

Fulgur

Your AI writes freely. Fulgur delivers with authority.

An HTML/CSS to PDF library for Rust. Seal the output your AI agent generates into authoritative, permanent documents.

Get Started GitHub


Quick Start

cargo install fulgur-cli
fulgur render input.html -o output.pdf
# Cargo.toml
[dependencies]
fulgur = "0.5"
use fulgur::Engine;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let html = "<h1>Hello, Fulgur</h1>";
    let pdf = Engine::builder().build().render_html(html)?;
    std::fs::write("output.pdf", pdf)?;
    Ok(())
}
pip install pyfulgur
from pyfulgur import Engine

html = "<h1>Hello, Fulgur</h1>"
pdf = Engine().render_html(html)
with open("output.pdf", "wb") as f:
    f.write(pdf)
gem install fulgur
require "fulgur"

html = "<h1>Hello, Fulgur</h1>"
pdf = Fulgur::Engine.new.render_html(html)
File.binwrite("output.pdf", pdf)

Use Cases

  • ๐Ÿค– AI Agent Output

    Seal HTML reports generated by AI agents into authoritative, permanent PDFs.

  • ๐Ÿ“„ SaaS Invoice Generation

    Generate invoices and receipts dynamically from templates and JSON data in multi-tenant environments.

  • ๐Ÿ“Š Batch Reports

    Produce thousands of PDFs in parallel from JSON data with deterministic, reproducible output.


Features

  • โšก Blazing Fast

    Throughput that outpaces wkhtmltopdf and Puppeteer. Benchmarked, not just claimed.

  • ๐Ÿฆ€ Pure Rust

    No headless browser, no Chromium, no C++ runtime. A single cargo add fulgur.

  • ๐Ÿ“ฆ Offline-First

    Zero network access at render time. Every asset is explicitly bundled โ€” perfect for sandboxed and WASM environments.

  • ๐Ÿ”’ Deterministic Output

    Same HTML + same bundled assets = byte-identical PDF, reproducible across machines.

  • ๐Ÿ““ CSS Paged Media (GCPM)

    Running headers/footers, page counters, named pages, and margin boxes โ€” the CSS spec that matters for real documents.


Comparison

Fulgur wkhtmltopdf WeasyPrint fullbleed Puppeteer Prince Gotenberg
Pure Rust โœ… โŒ โŒ โœ… โŒ โŒ โŒ
WASM support planned โŒ โŒ โŒ โŒ โŒ โŒ
CSS GCPM depth โ˜…โ˜…โ˜… โ˜…โ˜… โ˜…โ˜…โ˜… โ˜… โ˜…โ˜… โ˜…โ˜…โ˜…โ˜… โ˜…โ˜…
No headless browser โœ… โŒ โœ… โœ… โŒ โœ… โŒ
JavaScript execution โŒ โ–ณ โŒ โŒ โœ… โœ… โœ…
Serverless-friendly โœ… โœ… โœ… โœ… โ–ณ โ–ณ โ–ณ
Speed โšกโšกโšก โšก โšก โšกโšกโšก โšก โšกโšก โšก
License MIT/Apache LGPL BSD MIT MIT Commercial MIT
Install size small medium medium small large medium large

Prince is the reference implementation for CSS Paged Media and the closest benchmark for CSS coverage. Gotenberg requires Docker. Puppeteer and Gotenberg bundle a full Chromium installation.


Standing on the Shoulders of wkhtmltopdf

Fulgur was inspired by wkhtmltopdf โ€” a tool that served the web development community for over a decade. We built Fulgur to carry that legacy forward in the Rust era: faster, safer, and ready for the age of AI-generated documents.


MIT / Apache-2.0  ยท  GitHub  ยท  crates.io