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
|@hasStartedDownload|@startPagination| The event "hasStartedDownload" is now changed to "startPagination". |
45
+
| - |@hasPaginated| The event "hasPaginated" is an event triggered after pagination process is done. |
46
+
| - |@beforeDownload| The event "beforeDownload" is an event triggered before the PDF generation and downloading. The event arguments contains an object `{ html2pdf, options, pdfContent }`, which can be used to have full control of html2pdf.js like e.g.(Add page count on each PDF page, Full control of jsPDF to design page, etc.), you will have to set the props `:enable-download`, `:preview-modal` to false so it will not generate the PDF. |
47
+
|@hasGenerated|@hasDownloaded| The event "hasGenerated" is now changed to "hasDownloaded". |
|@progress| This will return the progress of the PDF Generation. The event argument contains the progress of the PDF generation process. |
202
+
|@startPagination| This will be triggered on start of pagination process. |
203
+
|@hasPaginated| This will be triggered after the pagination process. |
204
+
|@beforeDownload| This will be triggered before the PDF generation and download. The event arguments contains an object `{ html2pdf, options, pdfContent }`, which can be used to have full control of html2pdf.js like e.g.(Add page count on each PDF page, Full control of jsPDF to design page, etc.), you will have to set the props `:enable-download`, `:preview-modal` to false so it will not generate the PDF. |
205
+
|@hasDownloaded| This will be triggered after downloading the PDF. The event arguments contains the Blob File of the generated PDF. This will NOT be trigerred if the props `enable-download` AND `preview-modal` is set to false. |
206
+
207
+
#### Sample Use Case of @beforeDownload
208
+
This is a sample Use case of `@beforeDownload` event.
209
+
210
+
As you can see the event arguments contains a `{ html2pdf, options, pdfContent }` destructured object.
211
+
The arguments can used to have full control of the html2pdf.js process. See the Docs [here](https://www.npmjs.com/package/html2pdf.js#usage)
212
+
213
+
Below is a sample code to add a page number at the lower right on each PDF pages using the jsPDF package integrated in html2pdf.js.
214
+
215
+
NOTE that you will have to set the props `enable-download` and `preview-modal` to false so it will not generate any pdf.
216
+
You will have to handle the downloading yourself.
217
+
218
+
Please refer to the html2pdf [Docs](https://www.npmjs.com/package/html2pdf.js#usage) to know the full details of the usage of html2pdf.js
0 commit comments