npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ironpress

v1.4.4

Published

Pure Rust HTML/CSS/Markdown to PDF converter with layout engine, LaTeX math, tables, images, custom fonts, and streaming output. No browser, no system dependencies.

Readme

Ironpress

Pure rust HTML/CSS/Markdown to PDF converter. No browser, no system dependencies.

Crates.io PyPI Gem npm docs.rs CI codecov deps.rs MSRV License: MIT Downloads WASM Playground Parity report

Try it in your browser | HTML parity report | Wiki

Performance

Criterion measures complete, in-process conversion to PDF bytes:

| Document | Representative median | Approx. conversions/sec | |----------|----------------------:|------------------------:| | Simple HTML (<h1> + <p>) | 1.3 ms | 770 | | Styled HTML (CSS, lists, links) | 5.8 ms | 170 | | Markdown (headings, code, lists) | 11 ms | 89 | | Table (5 rows, styled headers) | 13 ms | 75 | | Full report (tables, flex, progress bars) | 30 ms | 33 |

Measured on Linux x86-64 with a Ryzen 9 5950X and Rust 1.97.1 at commit b4536834. The benchmark profile uses opt-level=3, fat LTO, and one codegen unit. Results depend on hardware and document content; conversions/sec is not a page-throughput claim. Reproduce the measurements with:

cargo bench --bench conversion

Quick start

use ironpress::html_to_pdf;

let pdf = html_to_pdf("<h1>Hello</h1><p>World</p>").unwrap();
std::fs::write("output.pdf", pdf).unwrap();
let pdf = ironpress::markdown_to_pdf("# Hello\n\nWorld").unwrap();

CLI

cargo install ironpress

ironpress input.html output.pdf
ironpress document.md output.pdf
ironpress --page-size letter --landscape --margin 54 input.html output.pdf
ironpress --header "Report" --footer "Page {page} of {pages}" input.html output.pdf
echo '<h1>Hello</h1>' | ironpress --stdin output.pdf

Builder API

use ironpress::{HtmlConverter, Margin, PageSize, RasterQuality};

let pdf = HtmlConverter::new()
    .page_size(PageSize::LETTER)
    .margin(Margin::uniform(54.0))
    .raster_quality(RasterQuality {
        background_dpi: 144.0,
        ..RasterQuality::default()
    })
    .header("My Document")
    .footer("Page {page} of {pages}")
    .convert("<h1>Custom page</h1>")
    .unwrap();

RasterQuality keeps source-image, filter, and flattened-background resolution in one physical-DPI policy. Its default preserves sharp source/filter output while using 192 DPI for flattened synthetic backgrounds; lowering one field does not change page geometry. The CLI exposes the same controls through --image-dpi, --filter-dpi, and --background-raster-dpi.

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 | 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 | 3500+ unit tests, property-based tests, 6 fuzz targets, 1,662-fixture parity corpus | Testing Strategy |

Custom fonts

let pdf = HtmlConverter::new()
    .add_font("Inter", std::fs::read("Inter.ttf").unwrap())
    .convert(r#"<p style="font-family: Inter">Shaped with HarfBuzz</p>"#)
    .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

pip install ironpress
import ironpress
pdf = ironpress.html_to_pdf("<h1>Hello</h1>")
gem install ironpress
require "ironpress"
pdf = Ironpress.html_to_pdf("<h1>Hello</h1>")

WASM

npm install ironpress
import init, { htmlToPdf, markdownToPdf } from 'ironpress';
await init();

const pdf = htmlToPdf('<h1>Hello</h1>');
const blob = new Blob([pdf], { type: 'application/pdf' });

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.

Visual parity harness

tests/parity/ is an adversarial HTML/CSS corpus with one focused fixture per feature, value, or interaction. Ironpress produces the candidate PDF; the declared oracle renderer's PDF is committed. At test time both PDFs go through the same discovered pdftoppm executable with the same 300 DPI arguments. A fixture passes only when a fixed, same-coordinate human-visibility policy finds no visible defect. Every raw RGBA difference remains in the evidence; the harness never translates, registers, or fixture-tunes either raster.

scripts/parity.sh                       # run the complete exact parity gate
scripts/parity-gen-refs.sh <category>   # regenerate oracle PDFs explicitly
scripts/parity-gen-refs.sh --check      # authenticate the complete corpus
  • Run it: scripts/parity.sh supplies a fresh invocation identity, renders every fixture in-process, rasterizes candidate and oracle PDFs symmetrically, and verifies that JSON, Markdown, and HTML all belong to that invocation.
  • Read it: the HTML parity report provides the complete visual evidence; tests/parity/REPORT.md is the compact, problem-first summary, and tests/parity/report.json contains the complete machine result.
  • Oracles: committed PDFs are the source of truth. Oracle-preview, candidate, and diff PNGs are generated report evidence and are intentionally ignored. refs.lock authenticates each fixture, oracle PDF, manifest entry, renderer, fonts, and generator provenance. Every future oracle PDF is generated only by the pinned Chromium Fontations/Foundation launcher; authenticated historical non-Chromium PDFs are evidence-only and cannot be regenerated.
  • Baseline: tests/parity/baseline.json is a separately reviewed regression snapshot. Updating it is explicit; retained FAILs remain current-health failures while their exact rasters become protected against movement or worsening.
  • CI: .github/workflows/parity.yml runs the same browser-free gate, checks refs.lock, and uploads the current report and evidence even when defects make the gate fail.

License

MIT