# PDFKit

> A JavaScript PDF generation library for Node and the browser.

Source: https://talira.ai/catalog/pdfkit-2tzqj5bd
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [documents / pdf / generation](https://talira.ai/categories/documents/pdf/generation), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Platforms: linux, macos, windows, web
- Licence: MIT
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes
- Backed by: [foliojs](https://talira.ai/orgs/foliojs.md)

PDFKit (foliojs/pdfkit, not Apple's PDFKit framework) builds PDFs programmatically through a canvas-like drawing API: vector paths, SVG path parsing, transforms and gradients, wrapped and aligned text, lists and tables, embedded and subset fonts (TrueType, OpenType, WOFF, WOFF2), JPEG and PNG images. It also supports annotations and links, AcroForms, outlines, encryption and access permissions, and tagged PDF / PDF/UA for accessibility. It runs in Node and in the browser via a bundler or a standalone build, and writes documents as a stream.

## Links

- Website: https://pdfkit.org/
- GitHub: https://github.com/foliojs/pdfkit
- Docs: https://pdfkit.org/docs/getting_started.html

## Problems it solves

- generate an invoice PDF from code in my Node backend, drawing text, lines and a logo myself
- I want full control over where every element goes on the page, not an HTML-to-PDF conversion
- stream a generated PDF straight into an HTTP response or S3 upload in Express
- draw charts and shapes into a PDF with a canvas-style API
- headless Chrome is too heavy for my serverless function, I just need to output simple documents
- build a printable report with wrapped paragraphs, bullet lists and custom fonts in JavaScript
- produce accessible tagged PDFs that pass PDF/UA checks from Node
- password-protect the PDFs my app generates and stop people printing or copying them
- create clickable links, bookmarks and a table of contents in a generated document
- make shipping labels or tickets as PDFs in the browser without a server
- embed WOFF2 web fonts and subset them so generated files stay small

## Features

- Canvas-like vector graphics API with SVG path parsing, transforms and gradients
- Text wrapping, alignment, soft hyphens and bulleted lists
- Tables
- Font embedding and subsetting (TrueType, OpenType, WOFF, WOFF2, collections)
- JPEG and PNG images, including transparency
- Annotations: links, notes, highlights, underlines
- AcroForms
- Outlines (bookmarks)
- Encryption and access permissions
- Tagged PDF and PDF/UA accessibility

## Capabilities

- Has official SDKs: plan not known

## Trust

Overall: 0.70 out of 1.
Signals: maintenance 1.00, adoption 0.81, momentum 0.54, community 0.86, backing 0.30, extensibility 0.00.

- last commit 20 days ago
- 75 commits in the last 90 days
- latest release v0.20.2 2 months ago
- 10.7k GitHub stars
- 144 contributors
- backed by foliojs

## Alternatives

- [Puppeteer](https://talira.ai/catalog/puppeteer-vbv4zakx.md): JavaScript API for Chrome and Firefox
- [jsPDF](https://talira.ai/catalog/jspdf-1ag2wrna.md): Client-side JavaScript PDF generation for everyone.
- [pdfmake](https://talira.ai/catalog/pdfmake-811sdqwj.md): PDF document generation library for Node.js and browsers, written in pure JavaScript
- [@react-pdf/renderer](https://talira.ai/catalog/react-pdf-renderer-e1aq29ey.md): PDFs, made with React
- [@cantoo/pdf-lib](https://talira.ai/catalog/cantoo-pdf-lib-2fgqrykx.md): An actively maintained fork of pdf-lib: create and modify PDF documents in any JavaScript environment
- [pdf-lib](https://talira.ai/catalog/pdf-lib-80dtat8x.md): Create and modify PDF documents in any JavaScript environment.
