eKoopmans / html2pdf.js

Client-side HTML-to-PDF rendering using pure JS.
MIT License
4.1k stars 1.39k forks source link

The html2pdf processing freezes the UI #28

Open lone-cloud opened 7 years ago

lone-cloud commented 7 years ago

Not sure if it's specific to my implementation, but I've noticed that the running html2pdf completely freezes the UI. Perhaps this can be fixed by running the conversions in a separate thread via service workers. Would be great if this lib did it so I don't have to implement it myself. ;)

Great job making this btw. I'm on the pdf-callback branch and it's a good addition. Just curious for the reason to not merge it into master?

eKoopmans commented 7 years ago

Hey @hoboman313, really sorry I didn't respond sooner. I like the idea about service workers, I don't have any experience in that though - if you do implement something, please share it and I'll try to merge it in!

Regarding the pdf-callback branch, it's not merged in because I've been planning a bigger change to the API that will give more control over all the steps of the process. With that change, pdf-callback will no longer be necessary - it's just a matter of finding the time. I recently took on a new job and I haven't had a chance to devote any time to coding, unfortunately! Soon... soon.

webmarts commented 6 years ago

@hoboman313 Finally how you solved this issue? I am facing the same issue my PDF is 16 to 25 pages long

eKoopmans commented 6 years ago

Hi, I have just pushed a new branch, new-api, which is ready for testing! The readme has all the information on the new API. Please let me know if there are any problems with it - I want to make sure it's stable before merging into master!

This doesn't resolve the issue of freezing the UI or service workers, but addresses @hoboman313's other question about the pdf-callback branch.

kevinpiac commented 6 years ago

Hey guys, I'm currently using the new-api branch, and I'm facing the same freezing issue. I'll need to fix that soon.

@eKoopmans should I do a fork and implement the change on my side or are you open to pull request? It would be awesome to merge this feature into new-api branch.

eKoopmans commented 5 years ago

Hi @kevinpiac, I haven't had much time to maintain this project, but if you did develop an improvement then absolutely submit a PR and I'll have a look. Thanks!

christyantoun commented 2 years ago

Hello, has this been solved yet? or is there any work around ?

mishinalex commented 2 years ago

Hello, has this been solved yet? or is there any work around ?

Hello, did you solve this?