Ironpress
Pure rust HTML/CSS/Markdown to PDF converter. No browser, no system dependencies.
Try it in your browser | Parity dashboard | Wiki
Performance
| Document | Time | Pages/sec |
|---|---|---|
Simple HTML (<h1> + <p>) |
16 us | 62,500 |
| Styled HTML (CSS, lists, links) | 71 us | 14,000 |
| Markdown (headings, code, lists) | 141 us | 7,000 |
| Table (5 rows, styled headers) | 341 us | 2,900 |
| Full report (tables, flex, progress bars) | 587 us | 1,700 |
Chrome headless takes ~2,500 ms per page. ironpress is 4,000x faster.
Quick start
use html_to_pdf;
let pdf = html_to_pdf.unwrap;
write.unwrap;
let pdf = markdown_to_pdf.unwrap;
CLI
|
Builder API
use ;
let pdf = new
.page_size
.margin
.header
.footer
.convert
.unwrap;
Features at a glance
| Area | Highlights | Details |
|---|---|---|
| HTML | 50+ elements: headings, tables, lists, forms, media, <img>, inline <svg> |
Layout Engine |
| CSS | Flexbox, grid, multi-column, calc(), variables, @media, @page, @font-face |
CSS Support |
| Fonts | Base-14 PDF fonts, custom TTF embedding with subsetting, system font discovery, Unicode/CJK fallback | Font System |
| Math | LaTeX via $...$ / $$...$$: fractions, roots, matrices, Greek, operators |
Math Engine |
| SVG | Vector rendering: path, shapes, gradients, transforms, clip paths, viewBox |
Layout Engine |
| Images | JPEG + PNG, data URIs, local files, remote URLs (remote feature) |
Architecture |
| PDF 1.4, bookmarks, link annotations, headers/footers, gradients, streaming output | PDF Rendering | |
| WASM | npm install ironpress - runs 100% client-side in the browser |
WASM & Playground |
| Testing | 2200+ unit tests, property-based tests, 6 fuzz targets, parity dashboard | Testing Strategy |
Custom fonts
let pdf = new
.add_font
.convert
.unwrap;
Fonts are shaped with rustybuzz, subset to used glyphs only, and embedded as CIDFontType2. Characters outside WinAnsi (CJK, Arabic, emoji) are rendered via automatic Unicode font fallback. See Font System.
Math
The equation $E = mc^2$ is famous.
$$\sum_{k=1}^{n} k = \frac{n(n+1)}{2}$$
Full LaTeX support: fractions, roots, matrices, Greek letters, operators, delimiters, accents. See Math Engine.
Python / Ruby
=
pdf = Ironpress.html_to_pdf()
WASM
import init from 'ironpress';
await ;
const pdf = ;
const blob = ;
See WASM & Playground.
Security
HTML is sanitized by default: <script>, <iframe>, event handlers, and javascript: URLs are stripped. Resources are sandboxed (local-only by default, 10 MB cap). SVG sanitizer strips dangerous elements. PNG decompression capped at 50 MB. Disable with .sanitize(false) if you trust the input.
How it works
HTML/Markdown → Sanitize → Parse (html5ever) → Style cascade → Layout engine → PDF 1.4
See Architecture for the full pipeline.
License
MIT