Comparing version 0.12.1 to 0.12.2
{ | ||
"name": "html3pdf", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"description": "html3pdf, based on html2pdf by ekoopmans", | ||
@@ -5,0 +5,0 @@ "main": "dist/html3pdf.js", |
@@ -1,4 +0,4 @@ | ||
# html3pdf.js | ||
# html3pdf | ||
html3pdf.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). | ||
html3pdf 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). | ||
@@ -48,3 +48,3 @@ This library is a continuation of, and is compatible with the API for, [html2pdf.js](https://github.com/eKoopmans/html2pdf.js) by [Erik Koopmans](https://github.com/eKoopmans). The majority of this README was written by Erik Koopmans. | ||
The simplest way to use html3pdf.js is to include it as a script in your HTML by using cdnjs: | ||
The simplest way to use html3pdf is to include it as a script in your HTML by using cdnjs: | ||
@@ -69,5 +69,5 @@ ```html | ||
Install html3pdf.js and its dependencies using NPM with `npm install --save html3pdf.js` (make sure to include `.js` in the package name). | ||
Install html3pdf and its dependencies using NPM with `npm install --save html3pdf` | ||
*Note: You can use NPM to create your project, but html3pdf.js **will not run in Node.js**, it must be run in a browser.* | ||
*Note: You can use NPM to create your project, but html3pdf **will not run in Node.js**, it must be run in a browser.* | ||
@@ -77,3 +77,3 @@ | ||
If you're on a webpage that you can't modify directly and wish to use html3pdf.js to capture a screenshot, you can follow these steps: | ||
If you're on a webpage that you can't modify directly and wish to use html3pdf to capture a screenshot, you can follow these steps: | ||
@@ -91,7 +91,7 @@ 1. Open your browser's console (instructions for different browsers [here](https://webmasters.stackexchange.com/a/77337/94367)). | ||
``` | ||
3. You may now execute html3pdf.js commands directly from the console. To capture a default PDF of the entire page, use `html2pdf(document.body)`. | ||
3. You may now execute html3pdf commands directly from the console. To capture a default PDF of the entire page, use `html2pdf(document.body)`. | ||
## Usage | ||
Once installed, html3pdf.js is ready to use. The following command will generate a PDF of `#element-to-print` and prompt the user to save the result: | ||
Once installed, html3pdf is ready to use. The following command will generate a PDF of `#element-to-print` and prompt the user to save the result: | ||
@@ -105,3 +105,3 @@ ```js | ||
Every step of html3pdf.js is configurable, using a Promise-based API. If html3pdf.js is called without arguments, it will return a `Worker` object: | ||
Every step of html3pdf is configurable, using a Promise-based API. If html3pdf is called without arguments, it will return a `Worker` object: | ||
@@ -121,6 +121,6 @@ ```js | ||
The basic workflow of html3pdf.js tasks (enforced by the prereq system) is: | ||
The basic workflow of html3pdf tasks (enforced by the prereq system) is: | ||
``` | ||
// The default in html3pdf.js | ||
// The default in html3pdf | ||
.from() -> .toContainer() -> .toCanvases() -> .toImgs() -> .toPdf() -> .save() | ||
@@ -170,3 +170,3 @@ | ||
html3pdf.js can be configured using an optional `opt` parameter: | ||
html3pdf can be configured using an optional `opt` parameter: | ||
@@ -206,5 +206,5 @@ ```js | ||
html3pdf.js has the ability to automatically add page-breaks to clean up your document. Page-breaks can be added by CSS styles, set on individual elements using selectors, or avoided from breaking inside all elements (`avoid-all` mode). | ||
html3pdf has the ability to automatically add page-breaks to clean up your document. Page-breaks can be added by CSS styles, set on individual elements using selectors, or avoided from breaking inside all elements (`avoid-all` mode). | ||
By default, html3pdf.js will respect most CSS [`break-before`](https://developer.mozilla.org/en-US/docs/Web/CSS/break-before), [`break-after`](https://developer.mozilla.org/en-US/docs/Web/CSS/break-after), and [`break-inside`](https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside) rules, and also add page-breaks after any element with class `html2pdf__page-break` (for legacy purposes). | ||
By default, html3pdf will respect most CSS [`break-before`](https://developer.mozilla.org/en-US/docs/Web/CSS/break-before), [`break-after`](https://developer.mozilla.org/en-US/docs/Web/CSS/break-after), and [`break-inside`](https://developer.mozilla.org/en-US/docs/Web/CSS/break-inside) rules, and also add page-breaks after any element with class `html2pdf__page-break` (for legacy purposes). | ||
@@ -278,3 +278,3 @@ #### Page-break settings | ||
html3pdf.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. | ||
html3pdf 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. | ||
@@ -293,3 +293,3 @@ If using the unbundled `dist/html3pdf.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: | ||
When submitting an issue, please remember that html3pdf.js is a wrapper around [html2canvas](https://github.com/niklasvh/html2canvas) and [jsPDF](https://github.com/MrRio/jsPDF), so it's a good idea to check each of those repositories' issue trackers to see if your problem has already been addressed. | ||
When submitting an issue, please remember that html3pdf is a wrapper around [html2canvas](https://github.com/niklasvh/html2canvas) and [jsPDF](https://github.com/MrRio/jsPDF), so it's a good idea to check each of those repositories' issue trackers to see if your problem has already been addressed. | ||
@@ -300,7 +300,7 @@ #### Known issues | ||
2. **Node cloning (CSS etc):** The way html3pdf.js clones your content before sending to html2canvas is buggy. A fix was being developed in html2pdf.js | ||
2. **Node cloning (CSS etc):** The way html3pdf clones your content before sending to html2canvas is buggy. A fix was being developed in html2pdf.js | ||
3. **Resizing:** Currently, html3pdf.js resizes the root element to fit onto a PDF page (causing internal content to "reflow"). This is often desired behaviour, but not always. | ||
3. **Resizing:** Currently, html3pdf resizes the root element to fit onto a PDF page (causing internal content to "reflow"). This is often desired behaviour, but not always. | ||
4. **Rendered as image:** html3pdf.js renders all content into an image, then places that image into a PDF. This means text is *not selectable or searchable*, and causes large file sizes. This is the unavoidable reality of the html3pdf.js system of using html2canvas to render everything first. jsPDF may be used as the renderer in the future to avoid this. | ||
4. **Rendered as image:** html3pdf renders all content into an image, then places that image into a PDF. This means text is *not selectable or searchable*, and causes large file sizes. This is the unavoidable reality of the html3pdf system of using html2canvas to render everything first. jsPDF may be used as the renderer in the future to avoid this. | ||
@@ -307,0 +307,0 @@ ### Tests |
4734322