whatisgithub

What is pdfmake?

bpampuch/pdfmake — explained in plain English

Analysis updated 2026-06-24

12,275JavaScriptAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A JavaScript library that generates PDF documents from a structured definition object, running in both web browsers and Node.js with support for tables, images, fonts, and page layouts.

Mindmap

mindmap
  root((pdfmake))
    Where it runs
      Web browser
      Node.js server
    Document Elements
      Paragraphs and text
      Tables and columns
      Images and lists
      Headers and footers
    Layout Options
      Page size and margins
      Portrait and landscape
      Multi-column flow
    Features
      Custom fonts
      Table of contents
      Page number references
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Generate a downloadable PDF invoice or report directly in the browser without any server round-trip

USE CASE 2

Build a Node.js service that creates formatted PDF documents like receipts, letters, or certificates

USE CASE 3

Add a print-to-PDF button to a web app that produces documents with tables, custom fonts, and page numbers

What is it built with?

JavaScriptNode.jspdfkit

How does it compare?

bpampuch/pdfmakeatomiks/tippyjsbrowsersync/browser-sync
Stars12,27512,27712,288
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min
MIT license, use freely for any purpose, including commercial, as long as you keep the copyright notice.

So what is it?

pdfmake is a JavaScript library that generates PDF documents. It works in two environments: inside a web browser, where it can create a PDF directly on the user's device, and on a server running Node.js, where it can generate PDFs as part of a back-end process. The library is driven by a document definition object. Instead of drawing on a page pixel by pixel, developers describe what a document should contain, including paragraphs, tables, images, lists, headers, and footers, and pdfmake handles all the layout calculations. It supports text alignment (left, right, centered, or justified), numbered and bulleted lists, tables with configurable column widths, column and row spans, automatically repeated table headers across page breaks, and a newspaper-style column layout where content flows from one column to the next. Other capabilities include embedded fonts, custom margins and page sizes, portrait or landscape orientation, a table of contents, multi-level nested structures, and document-level metadata such as author and subject fields. Page headers and footers can show static text or dynamic content that references the current page number and total page count. The library also provides helper functions to open a generated PDF in a new browser tab, print it directly, or trigger a file download. pdfmake is built on top of another library called pdfkit, which handles the lower-level PDF construction. An interactive playground is available online where developers can test document definitions in real time without installing anything. The library is released under the MIT license.

Copy-paste prompts

Prompt 1
Using pdfmake in my Node.js app, write me a document definition that creates an invoice with a header, an itemized table, a footer showing page numbers, and a total row
Prompt 2
Show me how to use pdfmake in the browser to generate a multi-page PDF with a table of contents and justified text columns
Prompt 3
How do I embed a custom font in a pdfmake document so all text uses it instead of the default font?
Prompt 4
Write a pdfmake document definition for a two-column newspaper-style layout with a title, body text, and a watermark

Frequently asked questions

What is pdfmake?

A JavaScript library that generates PDF documents from a structured definition object, running in both web browsers and Node.js with support for tables, images, fonts, and page layouts.

What language is pdfmake written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js, pdfkit.

What license does pdfmake use?

MIT license, use freely for any purpose, including commercial, as long as you keep the copyright notice.

How hard is pdfmake to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is pdfmake for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.