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
440 stars 74 forks source link

Filename in preview modal #35

Open mlanders opened 4 years ago

mlanders commented 4 years ago

When viewing preview-modal and downloading from that PDF viewer the filename provided as a prop isn't used.

Is there a way to get the filename to be used when viewing and downloading from the preview modal?

kempsteven commented 4 years ago

Hey there, as for now that is not possible yet, I will fix this issue in next days or week.

For version 1.8.x If you want to create your own preview modal and add a filename to be used when viewing and downloading you can set these props to false:

:enable-download="false"
:preview-modal="false"

and then use the @beforeDownload event and then generate your pdf blob and work out a way to add it to a modal.

Here is the complete detail of @beforeDownload usage and html2pdf.js usage

From what I did I just generated a bloburl from html2pdf.js and then added it to the iframe and made the iframe float.

mlanders commented 4 years ago

I was able to work around it for the time being but I appreciate you looking into it.

Thanks @kempsteven

kempsteven commented 4 years ago

Alright thanks @mlanders

Did you still use vue-html2pdf or html2pdf.js packages? If yes and if you have time could you share your solution?

Thanks again!

mlanders commented 4 years ago

I'm displaying my html content in a modal not in the vue-html2pdf preview-modal. I have provided the user with download button that uses vue-html2pdf to download as a pdf.

kempsteven commented 4 years ago

Cool, thank you for sharing

H2RockyRoad commented 3 years ago

Is this enhancement in progress? We are also looking for this functionality.

kempsteven commented 3 years ago

It is currently on hold, sorry

juanjcardona13 commented 3 years ago

Hi, Excusame, any advance please

Vnuuk commented 2 years ago

:(

kitdaniellim commented 2 years ago

:(

hanimirzapour commented 2 years ago

:(

jimmylee850328 commented 1 year ago
image

Same problem here :( Need help plz.

antoniopellegrini commented 7 months ago

I have this problem too, filename in modal view can't be changed

Alphajeez96 commented 6 months ago

I was able to work around it for the time being but I appreciate you looking into it.

Thanks @kempsteven

Hello @mlanders please would you be kind enough to share what your work around was?