pdfmake
A strong pick. 6th of 9 PDF libraries.
pdfmake is a mature, MIT-licensed library that builds PDFs from a declarative JSON document definition on top of PDFKit, in the browser and in Node.js. It is a solid choice for invoices and reports with tables. It only generates PDFs, though. It slows down on large tables, has no bundled TypeScript types, and needs care with URL access policies on servers.
Best for: Teams that want table-heavy reports or invoices from a declarative JSON layout, without hand-positioning content or running a headless browser.
Scores
Overall7.2
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
pdfmake is a good, actively maintained choice when you want declarative, table-heavy PDF generation without a headless browser. It is weaker on large-table speed, TypeScript experience and maintainer depth. Server use needs a careful security setup. React-pdf renderer suits React teams better, and PDFKit is better when you need low-level control. pdfmake stays a reasonable, but not default, pick for report and invoice generation.
- nutrient.io/blog/javascript-pdf-libraries: Best for structured documents, not for editing or viewing
- github.com/bpampuch/pdfmake/releases: Frequent releases from one maintainer
- peers: React-pdf renderer and PDFKit are also active, with comparable or larger use
GPT-6.2 Sol: 7.9, likely 6.7 to 8.8
For new reports and invoices with variable-length tables, pdfmake offers more automatic layout than PDFKit or jsPDF, with active releases and established downstream use. PDFKit is a stronger fit for precise drawing, and PDF.js is the choice for viewing existing PDFs. Concentrated release work and the need to configure server-side resource access keep the recommendation below a category-wide default.
- orshot.com/blog/nodejs-pdf-generator: Layout and speed trade-offs among generators
- cdn.e-iceblue.com/en/pdf/best-javascript-pdf-library.html: Compares specialist libraries for creation and viewing
- github.com/bpampuch/pdfmake/releases: Current fixes and concentrated release activity
- docs.amcharts.com/v5/tutorials/pdfmake-upgrade-notice-02-03: Current downstream adoption of the stable line
- github.com/advisories/GHSA-wp52-r2fp-4vmr: Server-side mitigation depends on configuring a URL access policy
Needed by many4.5
How many developers need a tool for this job?
Claude Opus 5.5: 4.5, likely 3.5 to 5.5
Making PDFs is a common need, mainly for reports, invoices and exports in business apps. pdfmake covers only the generation part of the category's job and does not read or show PDFs. That makes it a clear but medium-sized niche.
- nutrient.io/blog/javascript-pdf-libraries: Positioned for invoices, reports and structured layouts
- npm-compare.com/jspdf,pdf-lib,pdfjs,pdfkit,pdfmake,react-pdf: Classed as a generator, not a viewer or editor
GPT-6.2 Sol: 4.4, likely 3.1 to 5.8
Generating invoices, reports, and exports is a recurring need in business applications. Browser and Node.js support give pdfmake a broad audience within that job, while reading, editing, and viewing existing PDFs require other tools. The share of JavaScript projects that need generation from structured data is uncertain.
- npmjs.com/package/pdfmake: Generation features for browsers and Node.js
- datatables.net/ref/core/button/pdfHtml5: Browser-based table exports
- cdn.e-iceblue.com/en/pdf/best-javascript-pdf-library.html: Comparison across generation, reading, editing, and viewing
Helps a lot7.3
How well does it do the job for those who need it?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
Its declarative layout with automatic pagination, tables, headers and footers is the easiest way in this category to get structured documents without positioning by hand. Its limits are clear. Large tables are slow, right-to-left support is missing, types are not bundled, and styling is much less flexible than with HTML or React-pdf. AI agents write its JSON format well because it has years of examples.
- nutrient.io/blog/javascript-pdf-libraries: Pros: declarative, auto pagination; cons: RTL gap
- datatables.net/forums/discussion/34157: Users report slow generation for large tables
- npm hasTypes: No bundled TypeScript types
- github.com/bpampuch/pdfmake/releases: 0.3.15 fixes many layout and page-break issues
GPT-6.2 Sol: 8.0, likely 6.8 to 9.0
Declarative tables and pagination save layout work, and 0.3.15 fixes missing content in oversized rows and adds clearer overflow errors. PDFKit and jsPDF were faster on a small Node.js invoice benchmark. The documented object format helps developers and coding agents, but older callback examples and separately maintained types make version matching important. Small benchmark fixtures and an open report of extra blank lines in 0.3.13 leave some uncertainty about complex layouts.
- github.com/bpampuch/pdfmake/releases/tag/0.3.15: Pagination fixes, overflow errors, and image deduplication
- orshot.com/blog/nodejs-pdf-generator: Single-invoice benchmark across Node.js generators
- pdfmake.github.io/docs/0.3/migration-from-0.1: Promise-based methods and changed page-break callbacks
- npmjs.com/package/%40types/pdfmake?activeTab=versions: Separate 0.3-series TypeScript declarations
- github.com/bpampuch/pdfmake/issues/2962: Open user report on blank lines from empty text nodes
Holds up over time7.0
Will it still be a good choice in two years?
Claude Opus 5.5: 6.5, likely 5.5 to 7.5
Activity is strong, with 190 commits and 20 releases in the last year and a release the day before this review. It is built on PDFKit, which is also active. All recent releases come from one maintainer, liborm85, and no funding is visible, so the project depends on one person. It is still 0.x, and patch releases change default behaviour.
- github commitsLastYear / releasesLastYear: 190 commits, 20 releases
- github.com/bpampuch/pdfmake/releases: All releases published by one maintainer; default-behaviour changes in patches
- amcharts.com/docs/v5/?p=387385: The 0.2 to 0.3 upgrade broke APIs (Promises, addFonts)
GPT-6.2 Sol: 7.4, likely 6.0 to 8.5
The project recorded 190 commits and 20 GitHub releases in a year, and a user-reported spacing bug was fixed in 15 days. Recent GitHub releases consistently came from one maintainer, even though npm lists four collaborators. The 0.3 migration required downstream code changes, and concentrated release work makes the two-year outlook less certain.
- github commitsLastYear, releasesLastYear, latestRelease: Active maintenance and a November 20 release
- github.com/bpampuch/pdfmake/releases: One account published the recent GitHub releases
- github.com/bpampuch/pdfmake/issues/2960: November 5 spacing report fixed on November 20
- npmjs.com/package/pdfmake: Four listed npm collaborators
- docs.amcharts.com/v5/tutorials/pdfmake-upgrade-notice-02-03: Downstream migration changes for direct API users
Used widely6.1
How many use it, and is that growing?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
About 22,000 GitHub repositories depend on it, on par with PDFKit and jsPDF and above React-pdf. Its 18.3M downloads in 4 weeks are the lowest of the major peers except pdfme. Its growth ratio of about 4.3 is close to the 4.1 median, so it is holding ground, not gaining. Some downloads come through DataTables and charting libraries rather than direct choice.
- dependents repos: 22,251 repos, similar to PDFKit and jsPDF
- npm downloadsLast4Weeks / downloadsSame4WeeksYearAgo: 18.3M vs 4.3M, ratio about 4.3 vs median 4.1
- github stars: 12.4k stars
- bluesky posts / hackerNews stories: No recent social attention
GPT-6.2 Sol: 6.1, likely 5.0 to 7.3
The collector found 22,251 dependent repositories, close to PDFKit and jsPDF, alongside 12,366 stars. Four-week installs rose from 4.29 million to 18.29 million, a 4.26× increase that only slightly beats the 4.1× catalog baseline and trails every listed peer. Downstream bundles, CDN use, and automated installs make the number of fresh choices hard to estimate, and the supplied social snapshot adds little signal.
- dependents repos, packages; github stars: 22,251 repositories, 393 packages, and 12,366 stars
- npm downloadsLast4Weeks, downloadsSame4WeeksYearAgo; medianDownloadsRatio: 4.26× growth versus the 4.1× baseline
- peers; hackerNews stories; bluesky posts: Competitive dependent count, slower peer growth, and no matched social activity
- datatables.net/manual/extensions/buttons/installation: Downstream integration offers CDN and npm installation
- docs.amcharts.com/v5/tutorials/pdfmake-upgrade-notice-02-03: amCharts ships pdfmake 0.3 for PDF export
Vouched for6.6
Who stands behind it being good?
Claude Opus 5.5: 5.5, likely 4.5 to 6.5
Established products build on it, such as DataTables Buttons for PDF export and amCharts, which wrote an upgrade notice for its users. Independent comparisons regularly name it the pick for structured reports. It has no survey data and no recent benchmarks, and current developer discussion is thin.
- amcharts.com/docs/v5/?p=387385: amCharts depends on pdfmake and documents the upgrade
- datatables.net/forums/discussion/34157: DataTables uses pdfmake for PDF export
- nutrient.io/blog/javascript-pdf-libraries: Independent guide recommends it for invoices and reports
GPT-6.2 Sol: 7.6, likely 6.3 to 8.7
DataTables relies on pdfmake for its PDF export button, and amCharts 5 ships the 0.3 line. Recent third-party comparisons favor it for reports with tables that span pages, and a developer reported better pagination after switching from Puppeteer. The benchmark fixtures were small, and the State of JavaScript library rankings omit pdfmake, leaving satisfaction and retention harder to judge.
- datatables.net/ref/core/button/pdfHtml5: Required engine for DataTables browser PDF exports
- docs.amcharts.com/v5/tutorials/pdfmake-upgrade-notice-02-03: amCharts 5.18 ships pdfmake 0.3
- orshot.com/blog/nodejs-pdf-generator: Node.js benchmark and evaluation of growing tables
- cdn.e-iceblue.com/en/pdf/best-javascript-pdf-library.html: Vendor-run browser benchmark with disclosed methodology and fixtures up to ten pages
- reddit.com/r/webdev/comments/1rwe2tb/ive_been_working_on_dynamic_pdf_report_generation: Developer account of better dynamic table pagination
- 2025.stateofjs.com/en-US/libraries: Survey provides no pdfmake satisfaction or retention figure
Safe5.8
How safe is it to depend on?
Claude Opus 5.5: 5.5, likely 4.5 to 6.5
Two high-severity advisories since October 2025, one for SSRF and one for redirect throttling, were fixed with new access-policy APIs. The SSRF flaw had been present since 0.3.0-beta.2, and a public proof of concept exists. The OpenSSF Scorecard is 4.2, with no code review, branch protection, security policy or pinned dependencies, and releases come from one person. It has 5 direct dependencies, including PDFKit and its font stack, and an MIT licence.
- advisories last24Months: 2 high-severity advisories
- osv.dev/vulnerability/GHSA-wp52-r2fp-4vmr: SSRF affected 0.3.0-beta.2 to 0.3.5, fixed in 0.3.6
- wiz.io/vulnerability-database/cve/cve-2026-26801: Public proof-of-concept exploit
- scorecard score: 4.2, with weak review and branch protection
- npm license / dependencies: MIT, 5 direct dependencies
GPT-6.2 Sol: 6.1, likely 4.6 to 7.5
The two high-severity advisories in the bundle have patched versions, and 0.3.14 added per-document URL caching by default to address a newer vulnerability. The MIT package has five direct dependencies, and its release workflow uses GitHub Actions to publish with npm provenance. The 4.2 OpenSSF score reflects weak checks for code review, branch protection, and dependency pinning. Risk depends on how the application handles external resources, especially when a server accepts document definitions from untrusted users.
- github.com/advisories/GHSA-wp52-r2fp-4vmr: Server-side request forgery advisory records a fix in 0.3.6
- github.com/advisories/GHSA-rj3r-r7hh-jxfq: Redirect throttling fixed before the 0.3 stable release
- github.com/bpampuch/pdfmake/releases/tag/0.3.14: Default cache isolation addresses CVE-2026-119743
- raw.githubusercontent.com/bpampuch/pdfmake/0.3.15/.github/workflows/npm-publish.yml: Release-triggered npm workflow requests provenance
- npm license, dependencies; scorecard score, checks: MIT, five direct dependencies, and weak repository controls
Good
- A declarative document definition gives automatic pagination, tables, lists, headers, footers and custom fonts.
- The same code runs in the browser and in Node.js, with PDF/A and PDF/UA support in the 0.3 line.
- It is actively maintained, with 20 releases in the last year that fix many table and page-break bugs.
- It is widely embedded: DataTables, amCharts and over 22,000 GitHub repositories depend on it.
Bad
- Large tables generate slowly, especially in the browser.
- TypeScript types are not bundled and come from DefinitelyTyped, and full right-to-left text support is still missing.
- Server use needs explicit URL and local file access policies after two high-severity advisories since late 2025.
- It is still at 0.x after 12 years, and recent patch releases changed default behaviour such as URL caching, overflow handling and SVG errors.
The numbers
- npm downloads, 4 weeks
- 18M ×4.3 in a year
- GitHub stars
- 12k
- Commits, 12 months
- 190
- npm version
- 0.3.15 Nov 2026
- Versions, 12 months
- 19
- Advisories, 24 months
- 2 of 2 ever
- OpenSSF Scorecard
- 4.2 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (bpampuch/pdfmake), npm (pdfmake), OSV and the OpenSSF Scorecard.
PDF libraries
- 8.7PDF.js
- 7.6PDFKit
- 7.4React-PDF viewer
- 7.4unpdf
- 7.3React-pdf renderer
- 7.2pdfmake
- 6.9pdfme
- 6.4jsPDF
- 4.9pdf-lib