Skip to content

Commit 3be4900

Browse files
committed
Update install instructions and add Bower
1 parent 279073b commit 3be4900

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,35 @@ html2pdf converts any webpage or element into a printable PDF entirely client-si
44

55
## Getting started
66

7-
There are two ways to install html2pdf:
7+
### HTML
88

9-
1. **NPM:** Use `npm install --save html2pdf.js` to add html2pdf and its dependencies to your project.
10-
2. **HTML:** Download `dist/html2pdf.bundle.min.js` to your project folder and include it in your HTML with: `<script src="html2pdf.bundle.min.js"></script>`.
9+
The simplest way to use html2pdf is to download `dist/html2pdf.bundle.min.js` to your project folder and include it in your HTML with:
1110

12-
Once installed, html2pdf is ready to use. This command will generate a PDF of `#element-to-print` and prompt the user to save the result:
11+
```html
12+
<script src="html2pdf.bundle.min.js"></script>
13+
```
14+
15+
*[Click here](#dependencies) for more information about using the unbundled version `dist/html2canvas.min.js`.*
16+
17+
### NPM
18+
19+
Install html2pdf and its dependencies using NPM with `npm install --save html2pdf.js` (make sure to include `.js` in the package name).
20+
21+
*Note: You can use NPM to create your project, but html2pdf **will not run in Node.js**, it must be run in a browser.*
22+
23+
### Bower
24+
25+
Install html2pdf and its dependencies using Bower with `bower install --save html2pdf.js` (make sure to include `.js` in the package name).
26+
27+
## Usage
28+
29+
Once installed, html2pdf is ready to use. The following command will generate a PDF of `#element-to-print` and prompt the user to save the result:
1330

1431
```js
1532
var element = document.getElementById('element-to-print');
1633
html2pdf(element);
1734
```
1835

19-
*Note: html2pdf **will not run in Node.js**, it must be run in a browser.*
20-
21-
*[Click here](#dependencies) for more information about using the unbundled version `dist/html2canvas.min.js`.*
22-
2336
## Options
2437

2538
html2pdf can be configured using an optional `opt` parameter:

0 commit comments

Comments
 (0)