pdfkit

Installation
SKILL.md

PDFKit

Overview

PDFKit builds PDFs from code: you create a PDFDocument, call drawing methods, pipe it to a writable stream and call end(). It is streaming, so the same document can go to a file or an HTTP response. Checked against pdfkit 0.20.2 (August 2026), run in scratch with Node 24.

Things that differ from older write-ups: doc.table() is built in (added in the 0.17 line), so you no longer have to draw tables by hand; 0.20 removed the browser virtual file system (use registerFile) and exports PDFDocument as a named export as well as the default. PDFKit does not render HTML; for HTML to PDF use a headless browser instead.

Instructions

Install

npm install pdfkit
npm install -D @types/pdfkit typescript

@types/pdfkit (0.17.x) provides the TypeScript types, including table.

Installs
6
GitHub Stars
197
First Seen
Mar 13, 2026