kolinsky¶
HTML and CSS to PDF, in Rust, in milliseconds.
A Rust crate, a command line and a Python package. Paged media, flexbox, grid, tables, complex scripts, PDF/A and PDF/UA, without a browser and without system dependencies.
Install¶
One crate, one wheel or one binary. Nothing else to install.
v=$(curl -fsSL https://kolinsky.spenhouet.com/releases/latest.json | sed -n 's/.*"version": "\([^"]*\)".*/\1/p') && curl -fsSL "https://kolinsky.spenhouet.com/releases/v$v/kolinsky-$v-x86_64-unknown-linux-gnu.tar.gz" | tar xz && sudo mv "kolinsky-$v-x86_64-unknown-linux-gnu/kolinsky" /usr/local/bin/
v=$(curl -fsSL https://kolinsky.spenhouet.com/releases/latest.json | sed -n 's/.*"version": "\([^"]*\)".*/\1/p') && curl -fsSL "https://kolinsky.spenhouet.com/releases/v$v/kolinsky-$v-aarch64-unknown-linux-gnu.tar.gz" | tar xz && sudo mv "kolinsky-$v-aarch64-unknown-linux-gnu/kolinsky" /usr/local/bin/
From HTML to PDF¶
Give it a file, a string or a URL you allow, get the PDF bytes back.
use kolinsky::{Engine, Input, PdfOptions, RenderOptions};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let engine = Engine::new();
let input = Input::Path("hello.html".into());
let rendered = engine.render(input, &RenderOptions::default(), &PdfOptions::default())?;
for d in &rendered.diagnostics {
eprintln!("{}: {}", d.code, d.message);
}
std::fs::write("hello.pdf", rendered.output)?;
Ok(())
}
hello.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Invoice 2026-042</title>
<style>
@page {
size: A6 landscape;
margin: 12mm 12mm 14mm;
@bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7pt sans-serif; color: #777 }
}
body { font: 9pt/1.4 sans-serif; color: #222 }
header { display: flex; justify-content: space-between; align-items: baseline;
border-bottom: 2px solid #c25129; margin-bottom: 4mm }
h1 { font-size: 16pt; margin: 0; color: #c25129 }
table { width: 100%; border-collapse: collapse }
th, td { padding: 1.2mm 2mm; border-bottom: 0.5pt solid #ddd; text-align: left }
td:last-child, th:last-child { text-align: right }
tfoot td { font-weight: bold; border-bottom: none }
</style>
</head>
<body>
<header><h1>Invoice</h1><span>No. 2026-042</span></header>
<table>
<thead><tr><th>Item</th><th>Hours</th><th>Amount</th></tr></thead>
<tbody>
<tr><td>Layout review</td><td>4</td><td>€ 480.00</td></tr>
<tr><td>Print stylesheet</td><td>6</td><td>€ 720.00</td></tr>
<tr><td>PDF/UA check</td><td>2</td><td>€ 240.00</td></tr>
</tbody>
<tfoot><tr><td>Total</td><td></td><td>€ 1,440.00</td></tr></tfoot>
</table>
</body>
</html>

The image is the PDF that these lines write, rasterized; the docs build renders it with kolinsky every time.
Speed¶
Wall time per document, from process start to the PDF written, on a log scale. Shorter is faster. Point at a document for every engine's time, switch to peak memory, or hide engines in the legend.
Measured on 2026-11-12 on one machine (x86_64 12 CPUs), all engines with the same fonts.
Conformance¶
The share of tests passed: overall, in the web area (CSS and SVG reftests of the web-platform-tests) and in the PDF area (PDF feature and paged-media checks). Pick an area to rank the engines by it.
Results of 2026-11-14, web-platform-tests commit 4c84956f8341.
Every engine, method and the scores per group
Features¶
The CSS that print documents need, and the PDF features that archives and screen readers need.
-
Paged media
@pagesizes and margins, the 16 margin boxes, page counters, named pages, running headers -
Flexbox and grid
Flex containers and CSS grid, also split across pages
-
Multi-column
Columns with balancing, spanners and column rules
-
Floats and positioning
Floats, absolute, fixed and relative positioning
-
Tables
Fixed and automatic layout, collapsed borders, headers and footers repeated on every page
-
Fonts and complex scripts
@font-facewith WOFF, OpenType features, Arabic, Indic, Thai and CJK shaping, bidirectional text, hyphenation -
SVG and images
Inline and external SVG, PNG, JPEG, GIF and WebP
-
Links and outline
Internal and external links, PDF bookmarks from headings
-
PDF/A, PDF/UA and tagged PDF
PDF/A-2b, A-3u and A-4, PDF/UA-1 and UA-2, structure tags
-
Forms and attachments
HTML form controls drawn on the page, files embedded with
--attachor by the document -
Network off by default
Documents load only local files unless you allow URLs
-
No system dependencies
One binary or wheel on Linux, macOS and Windows; fonts come from the system or your own folders