惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
D
Docker
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
J
Java Code Geeks
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Simon Willison's Weblog
Simon Willison's Weblog
S
Security Affairs
NISL@THU
NISL@THU
T
Tor Project blog
A
About on SuperTechFans
宝玉的分享
宝玉的分享
腾讯CDC
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Privacy & Cybersecurity Law Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
P
Privacy International News Feed
雷峰网
雷峰网
C
Cyber Attacks, Cyber Crime and Cyber Security
Vercel News
Vercel News
Cisco Talos Blog
Cisco Talos Blog
D
DataBreaches.Net
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
L
LINUX DO - 热门话题
Microsoft Security Blog
Microsoft Security Blog
Latest news
Latest news
C
Check Point Blog
有赞技术团队
有赞技术团队
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
云风的 BLOG
云风的 BLOG
SecWiki News
SecWiki News
Application and Cybersecurity Blog
Application and Cybersecurity Blog
爱范儿
爱范儿
月光博客
月光博客
V
Vulnerabilities – Threatpost
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
T
The Blog of Author Tim Ferriss
C
Cisco Blogs
Webroot Blog
Webroot Blog
S
Security @ Cisco Blogs

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Introducing fulgur: a blazing fast HTML-to-PDF engine in Rust — no browser required
mitsuru · 2026-04-25 · via DEV Community

fulgur(noun, Latin) lightning, flash of lightning.

I've been building fulgur, an HTML-to-PDF engine written in Rust. No headless browser, no Chromium, no WebKit — just an HTML parser, a layout engine, and a PDF writer, glued together with a pagination layer.

The current numbers (v0.5.14, 200-page document):

  • 190 ms end-to-end
  • 57 MB peak memory
  • Byte-identical PDF output across runs

This post is the story of how it got there: why I started it, what it's built on, what it can do today, and how I've been working with AI tools to ship it as a solo project.

Why build yet another HTML-to-PDF tool?

For years, wkhtmltopdf was the default. It's now archived, and the WebKit version it bundles has been frozen for years. Modern CSS doesn't really land there.

The mainstream replacements all have tradeoffs:

  • Headless Chromium / Puppeteer / Playwright — gorgeous output, but you're shipping a browser. Cold start is slow, memory footprint is huge, and "just spin up Chrome in a container" stops being fun the moment you need to render thousands of PDFs a day.
  • WeasyPrint — solid CSS Paged Media support, but Python and not particularly fast on big documents.
  • Hosted services (Gotenberg, DocRaptor, etc.) — great until you can't send the data off-box, or until the per-PDF bill gets uncomfortable.

What I actually wanted was something that fit on the same server as my app, started instantly, and didn't blow up a Kubernetes pod's memory limit halfway through a 200-page report.

That's the niche fulgur is going after.

The "aha" moment: Blitz + Krilla

The unlock was realizing I didn't have to write a layout engine or a PDF writer from scratch. Two excellent crates already exist in the Rust ecosystem:

  • Blitz — an HTML rendering engine from the Dioxus project. It does HTML parsing, CSS style resolution, and layout (via Taffy and Parley). It's not a full browser — no JS runtime, no networking — which is exactly what you want for a PDF tool.
  • Krilla — a high-level PDF writing library. It hides the gnarly parts of the PDF spec behind a clean API: text, shapes, images, gradients, tagged PDF for accessibility, font subsetting, the works.

So the question became: can I write the glue between "Blitz says this box goes here" and "Krilla, please draw text at this coordinate" — plus a pagination layer that splits content across pages?

Turns out: yes. That glue is fulgur.

HTML / CSS
    │
    ▼
Blitz  ── DOM → style resolution → Taffy layout
    │
    ▼
DOM → Pageable conversion (Block / Paragraph / Image)
    │
    ▼
Pagination  ── split the Pageable tree at page boundaries
    │
    ▼
Krilla  ── draw each page → PDF Surface
    │
    ▼
PDF bytes

Enter fullscreen mode Exit fullscreen mode

While I was at it, I needed @media print support for things like print-only stylesheets. So I sent PR #390 to Blitz and it got merged upstream. Huge thanks to the Blitz maintainers — fulgur literally wouldn't be feasible without their work.

Performance

Here's where it gets fun. After landing a font caching change (wrapping the loaded font database in Arc so we don't reload Noto Sans JP for every page), the numbers shifted from "okay" to "actually production-ready":

Document Engine Time (ms) Peak Memory (MB)
Large (200 pages) fulgur 190 57
Large fullbleed 92 (n/a)
Large WeasyPrint 2,650 213
Large wkhtmltopdf 1,180 198
Medium fulgur 20 22
Medium WeasyPrint 516 74
Small fulgur 10 18

Two things stand out:

  1. Memory is the real story. 57 MB to render a 200-page document means you can run fulgur inside a normal-sized container without thinking about it. WeasyPrint and wkhtmltopdf use 3–4x more.
  2. 190 ms is fast enough that PDF generation stops being a background job. You can render on the request path for most documents.

Why isn't it even faster? The pipeline does a 2-pass render so that running headers/footers can show "Page X of Y" — page count needs to be known before laying out the page chrome. That cap is structural; I'd rather have correct page numbering than shave another 50 ms.

What v0.5.14 actually does

The version on Zenn was v0.3.0. A lot has shipped since:

  • Automatic page splitting with full CSS pagination control (break-before, break-after, break-inside, orphans, widows)
  • CSS Generated Content for Paged Media (GCPM) — page counters, running headers and footers, margin boxes
  • Built-in template engine — pass an HTML template + JSON data, get a PDF. Powered by MiniJinja.
  • Image embedding — PNG, JPEG, GIF
  • Custom font bundling with subsetting — TTF, OTF, TTC, WOFF2
  • PDF bookmarks auto-generated from h1h6
  • PDF metadata — title, author, keywords, language
  • External CSS injection, page sizes (A4 / Letter / A3) with landscape, configurable margins

Quick CLI tour

Install via npm (no Rust toolchain needed):

npx @fulgur-rs/cli render -o output.pdf input.html

Enter fullscreen mode Exit fullscreen mode

Or via Cargo:

cargo install fulgur-cli

Enter fullscreen mode Exit fullscreen mode

Basic usage:

# Convert a file
fulgur render -o output.pdf input.html

# Pipe HTML in
cat report.html | fulgur render --stdin -o report.pdf

# Page options
fulgur render -o output.pdf -s Letter -l --margin "20 30" input.html

# Bundle fonts and CSS
fulgur render -o output.pdf -f fonts/NotoSansJP.ttf --css print.css input.html

Enter fullscreen mode Exit fullscreen mode

Template + JSON

This is the part I'm most excited about, because it maps cleanly onto how AI agents want to generate documents.

invoice.html:

<h1>Invoice #{{ invoice_number }}</h1>
<p>{{ customer_name }}</p>
<table>
  {% for item in items %}
  <tr><td>{{ item.name }}</td><td>{{ item.price }}</td></tr>
  {% endfor %}
</table>

Enter fullscreen mode Exit fullscreen mode

data.json:

{
  "invoice_number": "2026-001",
  "customer_name": "Acme Corp",
  "items": [
    { "name": "Widget", "price": "$10.00" },
    { "name": "Gadget", "price": "$25.00" }
  ]
}

Enter fullscreen mode Exit fullscreen mode

fulgur render -o invoice.pdf -d data.json invoice.html

Enter fullscreen mode Exit fullscreen mode

An AI agent emitting JSON is a very natural fit for this interface — it doesn't need to know anything about PDFs, just the data shape.

As a library

use fulgur::engine::Engine;
use fulgur::config::{PageSize, Margin};

let engine = Engine::builder()
    .page_size(PageSize::A4)
    .margin(Margin::uniform_mm(20.0))
    .title("My Document")
    .build();

let pdf = engine.render_html(html)?;

Enter fullscreen mode Exit fullscreen mode

Honest about where it is today

I want to be upfront about something: fulgur is not "throw any HTML at it and get pixel-perfect PDFs." It's not a browser. It's a pagination-aware renderer that supports a curated subset of HTML and CSS, and within that subset it produces clean, predictable output. Push outside the supported surface and you'll see weird layout, missing styles, or things that just don't render.

That's a real limitation today, and I'm not going to pretend otherwise.

But here's the bet I'm making — and the reason I think the curated-subset approach is fine, even good, in 2026:

The consumers of this API are increasingly going to be AI agents, and they already know the web platform.

LLMs have absorbed an enormous amount of HTML and CSS during training. If you give an agent a JSON payload and say "render this as an invoice PDF," it will reach for <table>, flex, grid, standard typography — the well-trodden parts of the web platform. Those are exactly the parts I'm prioritizing.

So the design target isn't "render any webpage as a PDF." It's "give an AI agent a templating surface where its existing web-standards knowledge produces the right document, deterministically, without spinning up a browser." Different goal, different tradeoffs, much smaller surface to get right.

To keep this honest rather than aspirational, fulgur runs against the Web Platform Tests suite — the same conformance suite the major browsers use. The pass rate is the metric I'm tracking the supported-subset against, and it climbs with every release. "What does fulgur actually support?" stops being a vibe and becomes a number.

Current numbers, to be transparent about it:

WPT suite Pass rate
css-page 62 / 257 (24.1%)
css-multicol 27 / 579 (4.7%)

Yes, those are low. They're also the real numbers, on the parts of the spec fulgur cares most about (Paged Media and multi-column layout). The point of putting them on the table is that they're now a number that can go up, release after release — not a hand-wavy "we support most of CSS." If you file a bug pointing at a specific WPT case that should pass, that's directly actionable.

That's where fulgur is heading. Today it's already useful for invoice-shaped, report-shaped, form-shaped documents. The supported surface grows — measurably — with every release.

Determinism, on purpose

One feature I want to call out separately: byte-identical output for identical input.

This sounds boring, but it's huge for CI. If your golden PDFs change byte-for-byte every time you re-run the pipeline, diffing them is useless. Fulgur's pipeline (Blitz → Taffy → Parley → Krilla) is deterministic by design.

The one caveat is fonts: Blitz currently calls fontdb::Database::load_system_fonts() for SVG <text> elements, which means the same HTML can produce different output on machines with different system fonts. The repo ships a pinned Noto bundle and a fontconfig setup that keeps examples/*/index.pdf byte-identical across CI, so you can get reproducible output today by pointing FONTCONFIG_FILE at a controlled font set.

How I'm building it: AI-driven solo dev

Fulgur is a one-person project, but it's been built with a fairly heavy AI tooling setup. A few things that have actually worked:

Claude Code + superpowers

I do most of the implementation work in Claude Code with the superpowers plugin. The loop is:

  1. Brainstorm — talk through the design with Claude before writing anything
  2. Plan — turn the design into a stepwise implementation plan
  3. Implement — execute the plan, one chunk at a time

The brainstorm-then-plan structure keeps the agent from wandering off. It's also surprisingly good at catching "wait, this design has a hole" before any code is written.

term-cli for the debugger

term-cli lets an AI agent drive interactive programs through tmux. The killer use case for me is letting Claude Code drive a real debugger.

Without it, agents tend to fall back to println! debugging and spiral. With a debugger they can inspect variables directly, set breakpoints, and resolve "why is this layout offset wrong" in one shot. The behavior change is dramatic.

AI code review

I run Devin Review and CodeRabbit on every PR. PDF spec edge cases and CSS layout corner cases are exactly the kind of thing where having a second pair of eyes matters, and as a solo maintainer I don't have human reviewers. Both tools have caught real issues, especially around pagination edge cases.

It's not a substitute for a strong test suite — fulgur has a fixture-based golden PDF test setup — but it's a useful additional layer.

What's next

A few things on the roadmap:

  • More language bindings — Python (PyO3) and Ruby (Magnus) are already shipping; Node.js (napi-rs) is next.
  • More GCPM — there's still a long tail of CSS Paged Media features
  • A proper benchmarking harness that runs in CI on every release

The repo is here, with full README, threat model, and contribution guide:

👉 github.com/fulgur-rs/fulgur

Site: fulgur.dev

If you've been looking for a way to generate PDFs at scale without paying the Chromium tax, give it a try. Stars, issues, and PRs all very welcome — and if you hit a CSS edge case that breaks things, please open an issue with a minimal repro. That's the fastest path to fixing it.