-
Notifications
You must be signed in to change notification settings - Fork 169
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
TextLayerBuilder._bindEvents: this.cancel() should have been called when the page was reset, or rendering cancelled. #12
Comments
If anybody knows a better approach to embed the asset folder, please tell me. I can't believe that the Angular team really doesn't have a solution for additional resource files in a library. Any help welcome! |
Oops - I didn't notice you've provided a reproducer. When reading the mail sent by GitHub, the link is a detail that gets lost. Sorry! |
I've managed to reproduce the bug. However, I don't see any problems apart from the error message in the log file. What about you - is anything broken on your machine after the error message occurs? |
Side observation: When I hit CMD+F, a popup I assume to be the "find" menu appears. (I can only guess - I only speak a few words of Czech). When I enter a word like "the" or "such", there's no search result. I'm absolutely sure these words occur frequently in the document, so I'm puzzled. Plus, the search popup shouldn't show because you've deactivated it via |
Back to your bug report. At the moment, I suspect it's only a nuisance. Plus, nobody will ever detect it until looking at the JavaScript console. Is this correct? The bug itself seems to be caused by Mozilla's pdf.js implementation. So I believe you should report the bug at their repository. However, I'm afraid it's difficult to convince them it's there bug unless you provide a reproducer that doesn't use |
Yes, also buttons |
I can confirm that. Page navigation is broken. |
Also, I've just found another bug. ERROR TypeError: Cannot read property 'div' of undefined |
I suspect there are two or three different problems here:
The latter is caused by initializing the PDF viewer twice. When you click the "hide/show" buttons once, the "next" button jumps two pages ahead; click the buttons again, and "next" scrolls you three pages forward; and each new "hide/show" sequence increases the pagination distance agan. |
Parts of the PDFViewer remains in memory even after being hidden. The bugs seem to be related to mozilla/pdf.js#10021. |
I may have found something. It's only a partial solution, because there's still a memory leak, but it probably solves a problem or two. Add these lines before hiding the PDF file: back() {
(<any>window).PDFViewerApplication.unbindEvents();
(<any>window).PDFViewerApplication.unbindWindowEvents();
(<any>window).PDFViewerApplication.cleanup();
(<any>window).PDFViewerApplication.close();
this.router.navigateByUrl('dashboard');
} If this approach solves or meliorates your bugs, I'll add it to the However, I don't have any clue to to get rid of the PDFViewer instances accumulating in memory. Any suggestions? |
As for me this solution solves all three different problems. Thanks! |
I'll close the ticket, opening a follow-up ticket for the memory leak. |
Print Container and file Input Element appending at the document body each time when navigate changes from any page to this page. |
If click on
showPresentationModeButton
, the following error will show up:TextLayerBuilder._bindEvents:
this.cancel()
should have been called when the page was reset, or rendering cancelled.Steps for reproduce:
button
"Show PDF" -> click thebutton
"back" -> again click thebutton
"Show PDF" ->click
showPresentationModeButton
.P.S.
The error shows up only if you came from another component using router. If you refresh the page and click on
showPresentationModeButton
then nothing will happen.P.S.S.
I tried to upload the reproduction on some sandbox platform as stackblitz, but unfortunately I failed to add dependencies from
node_modules/ngx-extended-pdf-viewer/assets/
as it doesn't support (or I didn't find how) changes inscripts
inangular.json
The text was updated successfully, but these errors were encountered: