A guide for using PDFKit, a JavaScript library for generating PDF documents covering installation and usage.
This document serves as the user guide for PDFKit version 0.11.0, a JavaScript library designed for generating PDF documents. It details how to install the package using npm and provides examples of creating PDFDocument instances in both Node.js environments and web browsers.
The guide covers fundamental operations such as adding pages with specific layouts and margins, switching between buffered pages to add content retroactively, setting default fonts like Helvetica or Courier, and configuring document metadata including title, author, and keywords.
| Default Font | Helvetica |
|---|---|
| Version | 0.11.0 |
Use the npm package manager by typing 'npm install pdfkit'.
Yes, it can be used via module bundlers like Browserify or Webpack.
Enable bufferPages mode and use doc.switchToPage() to navigate back and add text.