You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@
2
2
3
3
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).
4
4
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
-
7
5
## Table of contents
8
6
9
7
-[Getting started](#getting-started)
@@ -231,19 +229,21 @@ The Worker object returned by `html2pdf()` has a built-in progress-tracking mech
231
229
232
230
## Dependencies
233
231
234
-
html2pdf.js depends on the external packages [html2canvas](https://github.com/niklasvh/html2canvas), [jsPDF](https://github.com/MrRio/jsPDF), and [es6-promise](https://github.com/stefanpenner/es6-promise). These dependencies are automatically loaded when using NPM or the bundled package.
232
+
html2pdf.js depends on the external packages [html2canvas](https://github.com/niklasvh/html2canvas) and [jsPDF](https://github.com/MrRio/jsPDF). These dependencies are automatically loaded when using NPM or the bundled package.
235
233
236
234
If using the unbundled `dist/html2pdf.min.js` (or its un-minified version), you must also include each dependency. Order is important, otherwise html2canvas will be overridden by jsPDF's own internal implementation:
237
235
238
236
```html
239
-
<scriptsrc="es6-promise.auto.min.js"></script>
240
237
<scriptsrc="jspdf.min.js"></script>
241
238
<scriptsrc="html2canvas.min.js"></script>
242
239
<scriptsrc="html2pdf.min.js"></script>
243
240
```
244
241
245
242
## Contributing
246
243
244
+
> [!TIP]
245
+
> Working on html2pdf.js locally? Use `npm start` to host local demos on http://localhost:8000.
246
+
247
247
### Issues
248
248
249
249
When submitting an issue, please provide reproducible code that highlights the issue, preferably by creating a fork of [this template jsFiddle](https://jsfiddle.net/u6o6ne41/) (which has html2pdf.js already loaded). Remember that html2pdf.js uses [html2canvas](https://github.com/niklasvh/html2canvas) and [jsPDF](https://github.com/MrRio/jsPDF) as dependencies, so it's a good idea to check each of those repositories' issue trackers to see if your problem has already been addressed.
@@ -269,7 +269,6 @@ When submitting an issue, please provide reproducible code that highlights the i
269
269
- Related project: [Feature: New renderer](https://github.com/eKoopmans/html2pdf.js/projects/4)
270
270
271
271
5.**Promise clashes:** html2pdf.js relies on specific Promise behaviour, and can fail when used with custom Promise libraries.
272
-
- In the next release, Promises will be sandboxed in html2pdf.js to remove this issue.
273
272
- Related project: [Bugfix: Sandboxed promises](https://github.com/eKoopmans/html2pdf.js/projects/11)
274
273
275
274
6.**Maximum size:** HTML5 canvases have a [maximum height/width](https://stackoverflow.com/a/11585939/4080966). Anything larger will fail to render.
@@ -279,7 +278,7 @@ When submitting an issue, please provide reproducible code that highlights the i
279
278
280
279
### Tests
281
280
282
-
html2pdf.js is currently sorely lacking in unit tests. Any contributions or suggestions of automated (or manual) tests are welcome. This is high on the to-do list for this project.
281
+
html2pdf.js performs automatic vdiff (visual difference) comparisons on PDFs generated from a collection of sample HTML files. Contributions of additional test cases are more than welcome - see `test/vdiff/html2pdf.vdiff.js` and `test/reference/*.html` for examples. Some changes may require adding more options to the test harness, `test/util/test-harness.js`.
0 commit comments