PDFKit
A PDF generation library for Node.js.
Description
PDFKit is a PDF document generation library for Node that makes creating complex, multi-page, printable documents easy. It is written in pure CoffeeScript, but you can choose to use the API in plain 'ol JavaScript if you like. The API embraces chainability, and includes both low level functions as well as abstractions for higher level functionality. The PDFKit API is designed to be simple, so generating complex documents is often as simple as a few function calls. Check out some of the documentation and examples to see for yourself!
Installation
Installation uses the npm package manager. Just type the following command after installing npm.
npm install pdfkit
Features
-
Vector graphics
- HTML5 canvas-like API
- Path operations
- SVG path parser for easy path creation
- Transformations
-
Text
- Line wrapping
- Text alignments
- Bulleted lists
-
Font embedding
- Supports TrueType (
.ttf
), TrueType Collections (.ttc
), and Datafork TrueType (.dfont
) fonts
- Supports TrueType (
-
Image embedding
- Supports JPEG and PNG files (including indexed PNGs, and PNGs with transparency)
-
Annotations
- Links
- Notes
- Highlights
- Underlines
- etc.
Coming soon!
- Gradients and patterns
- Outlines
- PDF Security
- Font subsetting
- Higher level APIs for creating tables and laying out content
- More performance optimizations
- Even more awesomeness, perhaps written by you! Please fork the repository and send me pull requests.
Example
The PDF output from this example (with a few additions) shows the power of PDFKit — producing complex documents with a very small amount of code.
License
PDFKit is licensed under the MIT license.