GitHub - cosmiciron/vmprint: A pure-JS, zero-dependency typesetting engine that yields bit-perfect PDF output across any runtime—from Cloudflare Workers to the browser. Stop using Headless Chrome to print text.
Hacker News
March 1, 2026
AI-Generated Deep Dive Summary
GitHub's VMPrint is a groundbreaking, pure-JavaScript typesetting engine designed to generate bit-perfect PDF outputs across any runtime, from Cloudflare Workers to web browsers. Unlike traditional methods that rely on heavy tools like Headless Chrome or HTML-to-PDF converters, VMPrint offers a lightweight, zero-dependency solution for deterministic and high-performance document generation. This innovation eliminates the compromises associated with these tools—such as inconsistent layout, memory leaks, and resource-heavy dependencies—by providing a stable alternative that ensures identical output across environments.
The engine operates in two distinct stages: layout and rendering. In the first stage, VMPrint processes structured JSON input (or Markdown via draft2final) to handle complex tasks like hyphenation, line wrapping, pagination, and table formatting. This stage produces a Page[] stream, which is a serialized JSON representation of the document's pages. By separating layout from rendering, VMPrint allows for easy debugging, versioning, and inspection of the output. In the second stage, the engine renders this Page[] stream into PDF or other formats, ensuring consistent results regardless of the runtime environment.
VMPrint’s core strength lies in its ability to replicate professional-grade typesetting without relying on external libraries or heavy browser-based rendering. It supports multilingual text shaping for scripts like Latin, CJK, and RTL, making it versatile for global audiences. The engine also offers pluggable font and rendering backends, enabling customization while maintaining minimal resource usage—its core weighs just 88 KiB and can render complex documents in milliseconds. This efficiency makes it ideal for applications requiring fast, reliable document generation, such as web-based tools or serverless environments like Cloudflare Workers.
For developers and tech enthusiasts, VMPrint represents a significant
Verticals
techstartups
Originally published on Hacker News on 3/1/2026