Navigate:
~$JSPDF0.1%

jsPDF: Client-side JavaScript PDF generation

Generate PDF documents in-browser with JavaScript APIs.

LIVE RANKINGS • 11:03 AM • STEADY
OVERALL
#313
59
DEVELOPER TOOLS
#63
11
30 DAY RANKING TREND
ovr#313
·Devel#63
STARS
31.1K
FORKS
4.8K
7D STARS
+25
7D FORKS
-1
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.0.0

This release fixes a critical path traversal/local file inclusion [security vulnerability](https://github.com/parallax/jsPDF/security/advisories/GHSA-

  • 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

This release includes a bunch of bugfixes. Thanks to all contributors!

  • [Snyk] Upgrade @babel/runtime from 7.28.3 to 7.28.4 by @MrRio in
  • fix: cell function now properly accepts align parameter by @vishal-rathod-07 in
  • Remove duplicated function "ga" from WebPDecoder.js by @jvdp in
  • Fix font state management issue #3890 by @srikanth-s2003 in
  • Fix pages property to always return current array reference ( #3898 ) by @Opineppes in
vv3.0.3

This release fixes regressions with PNG encoding that were introduced in v3.0.2.

  • Fix division by zero when calculating word spacing by @alxndr-pggm in
  • fix scaling of form object bounding boxes by @HackbrettXXX in
  • fix regressions in PNG encoding that were introduced in 3.0.2 by @HackbrettXXX in
  • @alxndr-pggm made their first contribution in

See how people are using jsPDF

Loading tweets...


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers