kempsteven / vue-html2pdf

vue-html2pdf converts any vue component or element into PDF, vue-html2pdf is basically a vue wrapper only and uses html2pdf.js behind the scenes.
https://www.npmjs.com/package/vue-html2pdf
MIT License
432 stars 75 forks source link

Use @beforeDownload and generatePdf() action generates two PDF #141

Closed JacquesJahnichen closed 1 year ago

JacquesJahnichen commented 2 years ago

Hello,

How can I add a button to "Dowload the PDF" and use @beforeDownload in a same time to add a footer ? When I do that I download two pdf

image

image

JacquesViviarto commented 2 years ago

A little reminder on this subject

JacquesViviarto commented 2 years ago

If anyone has an idea to solve this problem, it is welcome.

rogerio-pereira commented 1 year ago

+1

rogerio-pereira commented 1 year ago

@JacquesViviarto set both variables: preview-modal and enable-download to false

That solved for me

AloneInMyMind commented 1 year ago

@JacquesViviarto set both variables: preview-modal and enable-download to false

That solved for me

The problem of this solution is that now the @hasDownloaded doesn't work anymore, if anyone has a solution please let me know

rogerio-pereira commented 1 year ago

@AloneInMyMind use beforeDownload, also set both variables. It`s working for me

JacquesViviarto commented 1 year ago

Thanks for your help. This config work for me

<vue-html2pdf
          :preview-modal="false" 
          :enable-download="false"
          @beforeDownload="beforeDownload">