Skip to content

Commit 2129120

Browse files
authored
Update README.md
1 parent f6c5e83 commit 2129120

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
html2pdf.js converts any webpage or element into a printable PDF entirely client-side using [html2canvas](https://github.com/niklasvh/html2canvas) and [jsPDF](https://github.com/MrRio/jsPDF).
44

5+
> :warning: There have been several issues reported in v0.10. They are being investigated but in the meantime you may wish to remain on v0.9.3 ("^0.9.3" in npm, or [use cdnjs for HTML script tags](https://cdnjs.com/libraries/html2pdf.js/0.9.3)).
6+
57
## Table of contents
68

79
- [Getting started](#getting-started)
8-
- [HTML](#html)
10+
- [CDN](#cdn)
11+
- [Raw JS](#raw-js)
912
- [NPM](#npm)
1013
- [Bower](#bower)
1114
- [Console](#console)
@@ -30,15 +33,25 @@ html2pdf.js converts any webpage or element into a printable PDF entirely client
3033

3134
## Getting started
3235

33-
#### HTML
36+
#### CDN
3437

35-
The simplest way to use html2pdf.js is to download `dist/html2pdf.bundle.min.js` to your project folder and include it in your HTML with:
38+
The simplest way to use html2pdf.js is to include it as a script in your HTML by using cdnjs:
3639

3740
```html
38-
<script src="html2pdf.bundle.min.js"></script>
41+
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
3942
```
4043

41-
*Note: [Click here](#dependencies) for more information about using the unbundled version `dist/html2canvas.min.js`.*
44+
Using a CDN URL will lock you to a specific version, which should ensure stability and give you control over when to change versions. cdnjs gives you access to [all past versions of html2pdf.js](https://cdnjs.com/libraries/html2pdf.js).
45+
46+
*Note: [Read about dependences](#dependencies) for more information about using the unbundled version `dist/html2canvas.min.js`.*
47+
48+
#### Raw JS
49+
50+
You may also download `dist/html2pdf.bundle.min.js` directly to your project folder and include it in your HTML with:
51+
52+
```html
53+
<script src="html2pdf.bundle.min.js"></script>
54+
```
4255

4356
#### NPM
4457

@@ -63,7 +76,7 @@ If you're on a webpage that you can't modify directly and wish to use html2pdf.j
6376
script.src = url;
6477
document.head.appendChild(script);
6578
}
66-
addScript('https://raw.githack.com/eKoopmans/html2pdf/master/dist/html2pdf.bundle.js');
79+
addScript('https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js');
6780
```
6881
3. You may now execute html2pdf.js commands directly from the console. To capture a default PDF of the entire page, use `html2pdf(document.body)`.
6982

0 commit comments

Comments
 (0)