Closed avm99963 closed 3 years ago
Hm, I've never seen this, though I use the package all the time. Are you certain that it isn't the PDF file itself that is broken, containing the same pages twice? Can you provide a recipe how to reproduce this?
I have been having this problem too. When reloading the page a new set of pdf.worker.js threads are created, and the old ones are not closed. I suspect that the view duplication is a result of having multiple threads all trying to display the document to the same window.
Calling win.PDFViewerApplication.close()
before opening the file https://github.com/allefeld/atom-pdfjs-viewer/blob/a9c8c8890572c9c81dad1a38704320f0717b963a/lib/pdfjs-viewer-view.js#L255 appears to fix both the view duplication and remove the excess threads.
I think I have created a pull request for this change
Awesome, thanks @Ludoric!
@allefeld: I'm a little bit busy right now, but given that Ludoric already submitted a PR, maybe that will fix it. If it doesn't, I'll try to share here some detailed reproduction steps when I have some time. Thanks!!
Thanks @Ludoric! I merged your pull request and published a new version of the package.
Please let me know whether this fixes the problem.
I've been writing a LaTeX file and recompiling it a lot of times, and this doesn't happen now, so it seems the PR really fixed the issue. I'll therefore close this issue.
Thanks to the both of you! :)
@Ludoric, you are the only person who has committed to this repository except me. I intend to abandon this project, since I've moved from Atom to VS Code. Would you be interested in taking it over?
This happens sometimes when performing the following steps:
In my case, I'm using pdfjs-viewer 1.0.1 (although this also occurred in previous versions) in Atom 1.56.0 using macOS 10.15.7.