Navigate:
~$JSPDF0.1%

jsPDF: Client-side JavaScript PDF generation

Generate PDF documents in-browser with JavaScript APIs.

LIVE RANKINGS • 10:20 AM • STEADY
OVERALL
#324
53
DEVELOPER TOOLS
#65
9
30 DAY RANKING TREND
ovr#324
·Devel#65
STARS
31.1K
FORKS
4.8K
7D STARS
+32
7D FORKS
+9
See Repo:
Share:

Learn more about jsPDF

jsPDF is a JavaScript library for creating PDF documents programmatically in client-side environments. It works by providing a JavaScript API that constructs PDF files according to the PDF specification, allowing developers to add content like text, shapes, and images directly in the browser. The library supports multiple module formats including ES2015, UMD, AMD, and Node.js variants, with optional dependencies for advanced features like HTML-to-PDF conversion. Common use cases include generating invoices, reports, and certificates on demand without requiring backend PDF generation services.

jsPDF

1

Universal Module Support

Ships with ES2015, UMD, AMD, and Node.js variants in a single package. Build tools automatically select the correct format without configuration, ensuring compatibility across different JavaScript environments and bundlers.

2

Dynamic Dependency Loading

Advanced features like HTML rendering and DOM sanitization load only when invoked. Keeps base bundle size minimal by excluding unused functionality, reducing initial load time for applications that need basic PDF generation.

3

Flexible Document Configuration

Supports custom page sizes, orientations, and units with fine-grained control over margins, headers, and footers. Generate documents matching specific print requirements or corporate templates programmatically.


import { jsPDF } from "jspdf";

const doc = new jsPDF();
doc.text("Invoice #12345", 10, 10);
doc.text("Total: $99.99", 10, 20);
doc.save("invoice.pdf");


vv4.1.0

Security-focused release fixing multiple vulnerabilities including PDF injection and XSS.

  • Upgrade optional dompurify dependency to 3.3.1
  • Fix PDF Injection in AcroForm module allows Arbitrary JavaScript Execution vulnerability
  • Fix Stored XMP Metadata Injection (Spoofing & Integrity Violation) vulnerability
  • Fix Shared State Race Condition in addJS Method vulnerability
  • Fix Denial of Service (DoS) via Unvalidated BMP Dimensions in BMPDecoder vulnerability
vv4.0.0

Critical security release fixing path traversal vulnerability with restricted file system access.

  • This release fixes a critical path traversal/local file inclusion security vulnerability in the jsPDF Node.js build
  • File system access is now restricted by default and can be enabled by either using node's `--permission` flag or the new `jsPDF.allowFsRead` property
vv3.0.4

Bug fixes for font state management, cell alignment, and TypeScript improvements.

  • fix: cell function now properly accepts align parameter
  • Remove duplicated function "ga" from WebPDecoder.js
  • Fix font state management issue
  • Fix pages property to always return current array reference

See how people are using jsPDF

Loading tweets...


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers