THE MINKPDF HANDBOOK

Meet MinkPDF

A compact JavaScript PDF engine. Familiar document definitions, zero runtime package dependencies, and only the features you need.

Your definition{ content: 'Hello' }
MGENERATED WITH MINKPDF
Hello.

A little code.
A real document.

Helvetica · A41 / 1
Definition → layout → PDF bytes

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#

DefineContent + styles
Lay outMeasure + paginate
SerializeFonts + streams

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#

Search pages, examples, and API methods.