HTML to PDF. In process. In pure Rust.
open sourceMITself-hostablefree
ironpress converts HTML, CSS and Markdown to PDF bytes inside your application with its own layout engine, so there is no headless browser, subprocess or system dependency to install. It handles flexbox, grid, tables, multi-column layout, @page rules, headers and footers, font shaping and subsetting, SVG and LaTeX math, and sanitizes HTML and SVG by default with remote fetching opt-in. The same Rust core ships as a CLI, a stable C ABI with C++ bindings, and packages for .NET, Java, Python, Ruby, Node.js and browser WebAssembly.
Problems it solves
- convert HTML and CSS to PDF in Rust without a headless browser
- running Chromium just to make invoice PDFs eats memory and makes our Docker image huge
- generate PDFs inside a serverless function where I can't install wkhtmltopdf or Chrome
- turn Markdown documents into nicely laid out PDFs from a command line
- make PDFs in the browser with WebAssembly so documents never leave the user's machine
- render HTML reports with flexbox and tables to PDF from Python or Ruby without a system dependency
- add page headers and 'Page 3 of 10' footers to generated PDFs
- embed custom fonts and CJK text in PDFs generated from HTML
- safely render user-supplied HTML to PDF without scripts or arbitrary file access
- generate thousands of simple PDFs per second in-process
- produce PDFs from a .NET or Java service without shelling out to another program
- render LaTeX math in documents exported to PDF
Features
- HTML, CSS and Markdown input
- flexbox, grid, tables, multi-column, @page
- text headers/footers with page numbers and HTML header/footer fragments
- font shaping with rustybuzz and subsetting
- optional CJK and emoji font packs
- SVG and LaTeX math
- HTML/SVG sanitization and constrained file access
- opt-in remote resource fetching
- CLI
- C ABI, C++, .NET, Java, Python, Ruby, Node.js and browser WebAssembly bindings
View 1 more
- browser playground and parity report
Capabilities
| Has a command line tool | plan not known |
|---|---|
| Has official SDKs | plan not known |
Alternatives
The same job
These do what ironpress does.
- WeasyPrint Renders HTML and CSS to PDF, from Python or the command line
- Gotenberg A Docker-based API for PDF
- Typst The new foundation for documents
- Puppeteer JavaScript API for Chrome and Firefox
- Prince Convert HTML to PDF. Beautiful printing with simple CSS.
- krilla A high-level, ergonomic Rust library for creating PDF documents.
