REFERENCE

MinkPDF & pdfmake

A familiar document-definition model, a smaller supported surface. Understand what carries over and what your application needs to adapt.

Keep the document definition#

Supported text, named styles, tables, and header/footer definitions follow a familiar model. The same definition can be passed to each engine, but line metrics and pagination can differ.

JavaScript
const definition = {
  content: [
    { text: 'Invoice', bold: true, fontSize: 18 },
    { table: { widths: ['*', 100], body: [
      ['Description', 'Amount'], ['Consulting', 'USD 100.00']
    ] } }
  ]
};

How the implementations differ#

AreaMinkPDFpdfmake 0.3.13
EngineOwn layout, pagination, TrueType subsetting, and PDF serializationUses PDFKit, linebreak, and xmldoc as runtime package dependencies
Entry pointsBuilt ESM; full root or core + optional feature factoriesClient build and server entry point; separate default font assets for the browser
CapabilitiesSelect report, graphics, font, security, and output capabilities at engine constructionBroader document-definition surface
Document creationcreatePdf(definition)createPdf(definition, options?) in 0.3
Binary outputawait getBuffer() → Uint8ArrayPromise-based buffer, Blob, base64, data URL, and stream methods
Download / open / printprint(target?); standalone downloadPdf() and openPdf() adaptersClient methods download(), open(), and print()
Server file outputwritePdf(document, path) through the Node adapterwrite(path) on the server-side document
FontsASCII Helvetica by default; register TrueType bytes or base64 for UnicodeDefault browser setup includes Roboto virtual font assets; custom fonts supported

pdfmake sources: 0.3.13 manifest, browser setup, client methods, and server setup.

Adapt the output step#

pdfmake · browser bytes

JavaScript
import pdfMake from 'pdfmake/build/pdfmake.js';
import pdfFonts from 'pdfmake/build/vfs_fonts.js';

pdfMake.addVirtualFileSystem(pdfFonts);
const bytes = await pdfMake
  .createPdf(definition).getBuffer();

MinkPDF · browser bytes

JavaScript
import pdf from 'minkpdf';

// ASCII + built-in Helvetica
const bytes = await pdf
  .createPdf(definition).getBuffer();
// Embed a TrueType font for Unicode.

For downloads, replace pdfMake.createPdf(definition).download('invoice.pdf') with getBlob() and an object URL. The complete browser example includes cleanup. Browser print(target?) supports the same preopened-window pattern as pdfmake 0.3. Standalone adapters expose downloadPdf(), openPdf(), and writePdf(). Documents expose getStream(); select streaming() for incremental serialization with backpressure. See the feature compatibility guide for caching and memory limits.

Register files explicitly#

For a matching font, supply the same TrueType bytes and variants to both engines. In MinkPDF, map virtual filenames to bytes or base64, then register the font dictionary and set defaultStyle.font.

JavaScript
pdf.addVirtualFileSystem({ 'Inter-Regular.ttf': fontBytes });
pdf.addFonts({ Inter: { normal: 'Inter-Regular.ttf' } });
const document = pdf.createPdf({
  defaultStyle: { font: 'Inter' },
  content: 'José García · ₱100'
});

addFonts() merges families; assigning pdf.fonts replaces them. Register every variant your document uses. Supply local or fetched bytes yourself; URL and filesystem font fetching are not part of MinkPDF’s registration API.

Compatibility at a glance#

Document capabilityMinkPDF status
Styled text, stacks, columns, named stylesSupported · optional reports adds justification and style inheritance
Tables, repeated headers, row/column spans, custom layoutsSupported · spans cannot cross the repeated-header boundary
Page breaks, headers/footers, metadata, watermarksSupported · optional graphics adds shapes
TrueType fonts and searchable Unicode textSupported · requires a font containing the characters
PNG / JPEG base64 data URLsSupported · PNG limits are documented in the API
Absolute/relative positioning, per-side margins, named colorsSupported · positioned nodes do not advance flow
SVG, QR codes, listsOptional factories · declared SVG subset
Attachments, encryption, PDF/AOptional factories · R6 AES-256; PDF/A-2b and PDF/A-3b
Semantic tagging / PDF/UA-1Optional profile · human accessibility review required
Complex-script shapingOutside the API
Pixel-identical layout with pdfmakeNot guaranteed · metrics and pagination differ

Before switching an application#

  1. Inventory the document features and output helpers your app uses.
  2. Check the supported types, colors, image formats, and font variants.
  3. Match each required capability to the historical root or explicit feature factories; advanced features are not all included by the root.
  4. Adapt downloads, file writes, and any callback-based output handling.
  5. Render representative real documents. Check text, totals, page breaks, and visual output.
  6. Measure your own workload. Use the recorded benchmarks as a reference, not a prediction.

Search pages, examples, and API methods.