PDFKit
A strong pick. 2nd of 9 PDF libraries.
PDFKit is a mature, low-level JavaScript library for making PDFs from code in Node and the browser. It is actively maintained and recently added tables, forms and PDF/UA tagging. It is a strong pick for building documents with full control, but it cannot read or edit existing PDFs, and its types come from a separate @types package.
Best for: Node developers who want exact, code-driven control over PDFs they make from scratch, such as invoices, reports and accessible tagged documents.
Scores
Overall7.6
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
PDFKit is a strong, actively maintained choice for code-driven PDF generation, and it is the engine under pdfmake. For declarative documents, pdfmake or React-pdf need less code. It is no help for reading or editing existing PDFs. The lack of bundled types and the 0.x breaking changes hold it back from the top tier.
- github commitsLastYear: Active development in the last year.
- dependents repos: Most dependent repositories in the category.
- github.com/foliojs/pdfkit/blob/master/CHANGELOG.md: Steady feature work, including tables and accessibility.
- pkgpulse.com/guides/pdf-lib-vs-jspdf-vs-pdfmake-pdf-generation-nodejs-2026: Peers cover editing and declarative layout.
GPT-6.2 Sol: 8.1, likely 7.0 to 9.0
PDFKit is a strong choice for new Node.js projects that generate documents from code, especially when page placement and streamed output matter. Pick pdfmake for declarative reports with complex layouts or PDF.js for viewing existing files. Recent maintenance and downstream adoption support the score, while browser setup and upgrade friction keep it short of a category-wide default.
- github.com/foliojs/pdfkit/blob/v0.21.0/README.md: Shows the streaming drawing API and the extra setup for some bundles.
- github.com/foliojs/pdfkit/releases: Shows active fixes and recent breaking changes.
- orshot.com/blog/nodejs-pdf-generator: Compares PDFKit's direct layout control with pdfmake's declarative layout.
- mozilla.github.io/pdf.js: Documents PDF.js as a parser and renderer.
Needed by many4.8
How many developers need a tool for this job?
Claude Opus 5.5: 5.0, likely 4.0 to 6.0
Making PDFs, such as invoices, reports and exports, is a common need in business web apps, but not in most projects. PDFKit covers only the "make" part of the category's job, not reading or showing PDFs. It runs on Node and in the browser, so it is not tied to one runtime.
- github description: Described as a PDF generation library for Node and the browser.
- nutrient.io/blog/top-js-pdf-libraries: Positioned for server-side invoices, reports and streamed downloads.
GPT-6.2 Sol: 4.5, likely 3.2 to 5.9
Generating invoices, tickets, and reports is a recurring need across web and backend projects. PDFKit works in Node.js and browsers without a framework requirement, but its scope is document creation. The developer survey shows that Node.js is widely used, while the share of developers who need to generate PDFs remains unclear.
- github.com/foliojs/pdfkit/blob/v0.21.0/README.md: Documents creation APIs and both runtime builds.
- survey.stackoverflow.co/2026/technology/data: 46.4% of web technology respondents reported using Node.js.
- orshot.com/blog/nodejs-pdf-generator: Compares common generation workflows and identifies PDFKit's fit for fixed layouts.
Helps a lot7.7
How well does it do the job for those who need it?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
The API is broad and mature: fonts, vector graphics, images, forms, encryption, tagged PDF and now tables with repeating headers. Layout is imperative, so complex documents take more code than with pdfmake or React-pdf. It cannot edit existing PDFs, and its types live outside the package. AI coding agents know the long-stable API well, but they may miss the recent 0.20 changes.
- github.com/foliojs/pdfkit/blob/master/CHANGELOG.md: 0.17 added tables, 0.19 added PDF/UA options, 0.21 added table header rows and page labels.
- pdfkit.org/docs/table.html: Built-in table support with many display options.
- npm hasTypes: The package ships no bundled TypeScript types.
- pkgpulse.com/guides/pdf-lib-vs-jspdf-vs-pdfmake-pdf-generation-nodejs-2026: Comparisons point to pdf-lib for editing and pdfmake for declarative layout.
GPT-6.2 Sol: 8.3, likely 7.1 to 9.2
The streaming API handles precise drawing, embedded fonts, forms, and tagged documents, and 0.21.0 adds repeating table headers. A browser benchmark found the previous release fast at generating short documents, with a slower first import than jsPDF. The examples give developers and coding agents a clear starting point, while the separate typings miss newer exports such as registerStdFonts. The available benchmarks leave performance on long documents in 0.21.0 uncertain.
- github.com/foliojs/pdfkit/blob/v0.21.0/README.md: Feature list, working examples, and bundling requirements.
- github.com/foliojs/pdfkit/releases/tag/v0.21.0: Adds repeating headers and fixes text, form, and image behavior.
- cdn.e-iceblue.com/en/pdf/best-javascript-pdf-library.html: A competing vendor published browser measurements on PDFKit 0.20.2.
- npm.hasTypes: The package ships no TypeScript declarations.
- github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pdfkit/index.d.ts: Community declarations omit registerStdFonts.
Holds up over time7.7
Will it still be a good choice in two years?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
Activity is steady: 167 commits and 7 releases in the last year, with v0.21.0 out the day before collection. pdfmake now depends on pdfkit directly, which ties another popular project to its upkeep. A small group of volunteer maintainers does the work, with no clear funding. The 0.20 release brought several breaking changes.
- github commitsLastYear / releasesLastYear: 167 commits and 7 releases in the last year.
- github latestRelease: v0.21.0 published 2026-11-20.
- unpkg.com/pdfmake@latest/package.json: pdfmake depends on pdfkit ^0.21.0.
- github.com/foliojs/pdfkit/blob/master/CHANGELOG.md: 0.20.0 had breaking changes; 0.19 raised the minimum to Node 20.
GPT-6.2 Sol: 7.8, likely 6.5 to 8.8
Seven releases and 167 commits in the past year show active maintenance, and the latest release addressed a reported production bundling failure. The 0.20 upgrade changed browser font setup and removed the virtual filesystem, so some upgrades require application changes. Recent GitHub releases come from one account, and long-term funding is unclear.
- github: 167 commits, seven releases, 264 open issues, and 36 open pull requests.
- github.com/foliojs/pdfkit/releases: One account published the seven most recent GitHub releases.
- github.com/foliojs/pdfkit/releases/tag/v0.20.0: Documents breaking changes to font registration and file handling.
- github.com/foliojs/pdfkit/issues/1801: A user reported a production Lambda bundling failure addressed in 0.21.0.
Used widely6.8
How many use it, and is that growing?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
Downloads were 68M in the last 4 weeks, against 4.9M a year before. That ratio of about 14 is well above the 4.1 median. Part of the growth comes from pdfmake now installing pdfkit directly. Still, its 23,418 dependent repositories are the most of any peer, which shows wide direct use.
- npm downloadsLast4Weeks / downloadsSame4WeeksYearAgo: 68.0M against 4.86M, a ratio of about 14.
- dependents repos: 23,418 repositories, slightly ahead of pdfmake and jsPDF.
- github stars: 10.7k stars, mid-pack among peers.
- unpkg.com/pdfmake@latest/package.json: pdfmake pulls in pdfkit, which inflates its downloads.
GPT-6.2 Sol: 6.5, likely 5.3 to 7.7
Ecosyste.ms found PDFKit in 23,418 repositories and 540 packages, with the highest repository count among the supplied peers. Four-week downloads rose from 4.86 million to 68.04 million, about 14 times the prior year and above the 4.1 times catalog median. Build installs and downstream use by pdfmake and React-pdf renderer leave the growth in direct choices uncertain. The bundle captured no Hacker News stories or Bluesky posts for PDFKit.
- dependents: 23,418 indexed repositories and 540 indexed packages.
- peers: PDFKit leads the supplied peer set in indexed dependent repositories.
- npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio: About 14 times year over year against a 4.1 times catalog median.
- hackerNews, bluesky: The collector found zero matches on both services.
- github.com/bpampuch/pdfmake/blob/0.3.15/package.json: pdfmake depends on upstream PDFKit 0.21.
- react-pdf.org/blog/dropping-the-pdfkit-fork: React-pdf switched from its fork to the upstream npm package.
Vouched for6.9
Who stands behind it being good?
Claude Opus 5.5: 6.0, likely 4.5 to 7.0
pdfmake builds on PDFKit as its rendering engine, and independent guides list it as a standard choice for server-side PDF generation. We found no survey data, independent benchmarks, or Hacker News and Bluesky discussion. Our evidence of named companies running it in production is thin.
- unpkg.com/pdfmake@latest/package.json: pdfmake depends on pdfkit.
- nutrient.io/blog/top-js-pdf-libraries: A vendor guide lists it among the top JS PDF generators.
- hackerNews / bluesky: No Hacker News stories and no Bluesky posts.
GPT-6.2 Sol: 7.7, likely 6.5 to 8.7
Two established generators rely on upstream PDFKit, and React-pdf reported matching output in its regression suite after switching from its fork. An outside Node.js comparison found PDFKit quick on a small invoice. These results cover specific workloads and earlier releases, and there is little survey evidence on PDFKit satisfaction.
- react-pdf.org/blog/dropping-the-pdfkit-fork: Reports matching visual regression output after adopting upstream PDFKit.
- github.com/bpampuch/pdfmake/blob/0.3.15/package.json: Confirms use in pdfmake's current release.
- orshot.com/blog/nodejs-pdf-generator: Reports a fast result for PDFKit 0.20 on a simple Node.js invoice.
Safe7.1
How safe is it to depend on?
Claude Opus 5.5: 7.5, likely 6.5 to 8.5
It has no advisories on record, only 6 dependencies, and an MIT licence. In 0.18 it replaced unmaintained dependencies (crypto-js, jpeg-exif). The OpenSSF Scorecard is only 4.3: it has no security policy, no signed releases, unpinned dependencies and no branch protection.
- advisories total: 0 advisories.
- scorecard score: 4.3, with zeros for Security-Policy, Signed-Releases, Pinned-Dependencies and Branch-Protection.
- npm dependencies: 6 runtime dependencies.
- github.com/foliojs/pdfkit/blob/master/CHANGELOG.md: 0.18 replaced crypto-js and jpeg-exif with maintained alternatives.
GPT-6.2 Sol: 6.6, likely 5.3 to 7.8
PDFKit uses the permissive MIT license, has six direct dependencies, and has no PDFKit advisories in the supplied OSV data. Version 0.21.0 picked up security fixes from its font and PNG dependencies. The 4.3 OpenSSF Scorecard flags weak workflow token permissions, unpinned dependencies, and missing release signing, branch protection, and security policy. npm lists four collaborators, and publishing provenance remains unverified.
- advisories, scorecard: Zero indexed package advisories and several weak supply-chain checks.
- npmjs.com/package/pdfkit?activeTab=dependencies: Lists four npm collaborators, six dependencies, and the MIT license.
- github.com/foliojs/pdfkit/releases/tag/v0.21.0: Records security fixes picked up through fontkit and png-js.
Good
- It has a rich drawing API: vector graphics, embedded and subset fonts, images, links, outlines, AcroForms, encryption and attachments.
- It supports tagged PDF and PDF/UA accessibility, and built-in tables now repeat their header rows across pages.
- It is actively maintained, with 7 releases and 167 commits in the last year, and has no known security advisories.
- pdfmake is built on it, so it is a proven engine with the most dependent repositories in its category.
Bad
- It only makes PDFs. To read, edit, merge or display existing PDFs you need pdf-lib or PDF.js.
- It ships no TypeScript types. You install @types/pdfkit, which can lag behind new APIs.
- Layout is manual and imperative. Complex documents take more code than pdfmake's declarative format or React-pdf's components.
- It is still 0.x after 15 years, and 0.20 brought breaking changes to browser font setup and exports.
The numbers
- npm downloads, 4 weeks
- 68M ×14 in a year
- GitHub stars
- 11k
- Commits, 12 months
- 167
- npm version
- 0.21.0 Nov 2026
- Versions, 12 months
- 7
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 4.3 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (foliojs/pdfkit), npm (pdfkit), 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