Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 10, 2024 via pnpm

jspdf 2.5.1

PDF Document creation from JavaScript
Package summary
Share
2
issues
2
high severity
license
1
meta
1
4
licenses
17
MIT
2
(MIT OR Apache-2.0)
1
(MPL-2.0 OR Apache-2.0)
1
MIT OR SEE LICENSE IN FEEL-FREE.md
Package created
19 May 2015
Version published
28 Jan 2022
Maintainers
1
Total deps
21
Direct deps
8
License
MIT

Issues

2

2 high severity issues

high
Recommendation: Validate that the license expression complies with your license policy
via: canvg@3.0.10
via: canvg@3.0.10 & others
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
17 Packages, Including:
@babel/runtime@7.24.5
@types/raf@3.4.3
base64-arraybuffer@1.0.2
canvg@3.0.10
core-js@3.37.0
css-line-break@2.1.0
fflate@0.4.8
html2canvas@1.4.1
jspdf@2.5.1
performance-now@2.1.0
raf@3.4.1
regenerator-runtime@0.13.11
regenerator-runtime@0.14.1
stackblur-canvas@2.7.0
svg-pathdata@6.0.3
text-segmentation@1.0.3
utrie@1.0.2

(MIT OR Apache-2.0)

Permissive
2 Packages, Including:
atob@2.1.2
btoa@1.2.1

(MPL-2.0 OR Apache-2.0)

Permissive
1 Packages, Including:
dompurify@2.5.2

MIT OR SEE LICENSE IN FEEL-FREE.md

Expression
1 Packages, Including:
rgbcolor@1.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

8
All Dependencies CSV
β“˜ This is a list of jspdf 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
@babel/runtime7.24.5256.12 kBMIT
prod optional
atob2.1.212.42 kB(MIT OR Apache-2.0)
prod
btoa1.2.111.19 kB(MIT OR Apache-2.0)
prod
canvg3.0.10347.7 kBMIT
prod optional
2
core-js3.37.01.17 MBMIT
prod optional
1
dompurify2.5.2727.92 kB(MPL-2.0 OR Apache-2.0)
prod optional
fflate0.4.866.85 kBMIT
prod
html2canvas1.4.1604.93 kBMIT
prod optional

Visualizations

Frequently Asked Questions

What does jspdf do?

jsPDF is a widely recognized library that is utilized to generate PDFs using JavaScript. Enthusiastically adopted due to its powerful features, jsPDF enables developers to create complex PDF documents and gives them the ability to perform tasks such as adding text, changing the printing orientation, setting format and size parameters, and much more.

How do you use jspdf?

To use jsPDF, install it via npm or yarn with the commands npm install jspdf --save or yarn add jspdf. Additionally, jsPDF can be loaded from a CDN or using the latest version via unpkg.

Below showcases a basic example of how you can leverage the jsPDF library:

import { jsPDF } from "jspdf";

// Create a new PDF document
const doc = new jsPDF();

// Add text to the document
doc.text("Hello world!", 10, 10);

// Save the document with a specific filename
doc.save("a4.pdf");

For more complex PDF configurations, the library allows the alteration of paper size, orientation or units. For instance, to create a 2x4 inches landscape document:

// Initialize a new PDF document with specific parameters
const doc = new jsPDF({
  orientation: "landscape",
  unit: "in",
  format: [4, 2]
});

// Add text to the document
doc.text("Hello world!", 1, 1);

// Save the document with a specific filename
doc.save("two-by-four.pdf");

Where are the jspdf docs?

The documentation for jsPDF, including various examples and detailed descriptions for each method, can be found at Documentation. The website houses a plethora of resources and guides that provide in-depth knowledge on how to effectively use the jsPDF library in your projects.