{ content: 'Hello' }A little code.
A real document.
Why MinkPDF exists#
Receipts, reports, and vouchers need reliable text, tables, and pagination. Shipping a broad PDF stack for those documents can add a substantial amount of code to an application. MinkPDF focuses on this smaller, practical document workflow.
The project’s development centers on a standalone engine with zero runtime package dependencies, a compact browser bundle, and a familiar document-definition model. It implements its own layout, font handling, and PDF serialization while supporting a useful subset of pdfmake’s API.
Optional feature modules make that focus explicit: a text-only app can import the core, while an invoice app can add tables and embedded fonts. The root import is a convenient starting point for its historical tables, images, and TrueType capabilities; advanced features require explicit selection.
Small by design#
Describe your document
Describe content and styles in JavaScript. Let the engine lay out and paginate the document.
Choose your capabilities
Compose tables, images, and TrueType fonts around a shared core. Bundle what your document needs.
One model across runtimes
Get PDF bytes in browsers, Node.js, and Bun through the same asynchronous output methods.
From content to PDF bytes#
The engine measures text, arranges content, and paginates it. It embeds and subsets registered TrueType fonts, embeds PNG/JPEG images, compresses streams with native Web APIs, and writes the PDF structure itself.
Rendering is lazy. Calling createPdf() prepares a document; the byte/Blob methods share one cached render. Browser printing separately caches a printable render.
Find your way#
Generate and save a receipt in a few lines.
Set up your environmentInstallation →ES modules, runtime requirements, and optional imports.
Coming from pdfmake?API comparison →Keep familiar definitions and adapt output handling.
Explore the measurementsBenchmarks →Render timings, bundle sizes, and reproducible results.