dai-shi / react-hooks-worker

React custom hooks for web workers
MIT License
700 stars 17 forks source link

pdf generation in background thread #50

Open mahamedh opened 2 years ago

mahamedh commented 2 years ago

is it possible to generate pdf using worker

dai-shi commented 2 years ago

probably? what's the pdf generation library in your mind?

mahamedh commented 2 years ago

probably? what's the pdf generation library in your mind?

yes i am using jspdf library in react web development, i am leading some latency when generating pdf,to provide good user experinece for the user i need to run the pdf generation in background....

mahamedh commented 2 years ago

Uncaught (in promise) ReferenceError: document is not defined i have tried jspdf pdf generation using react hooks worker i am facing above error @dai-shi

dai-shi commented 2 years ago

document is not defined

Ah, this means the library doesn't support running in web workers.

mahamedh commented 2 years ago

@dai-shi thanks for update save my time, any pdf gneration library developed on top web workers?

dai-shi commented 2 years ago

Hmm, no, I don't know. https://www.npmjs.com/search?q=pdf%20generation Maybe you want to find something that works both nodejs and browser.