-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to spawn multiple workers at once to render different PDFs? #16871
Comments
Unfortunately that's not really helpful, please see https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md (emphasis mine):
By default, unless you manually set certain options, each |
Thanks for the reply, yesterday I ran into an issue initially with asynchronous code where the browser would give an error: After reading some docs it appeared that if a worker was currently in the rendering process of a PDF, it would need to be waited upon for completion before the next PDF could begin. Unfortunately I don't think I can reproduce this issue now which is strange, but I implemented a solution afterward to force an array of file names to render one after another using callbacks and this is where the performance bottleneck for this issue I raised came about. I removed the callback logic just now and this time I no longer got the issue from the first paragraph above and it appears to be working as expected, I'm not sure what I did wrong previously. I'll close this as resolved, in particular I had confusion with how to set the workerSrc, but I found this comment helpful |
Attach (recommended) or Link to PDF file here:
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
Desired behavior is rendering of images asynchronously so that the bottleneck is the most detailed PDF image to be rendered
What went wrong? (add screenshot)
Loading is slower than I like, particularly if eventually I may want to load a lot more PDFs, is there a way to spawn simultaneous workers to speed up the process?
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
The text was updated successfully, but these errors were encountered: