-
Notifications
You must be signed in to change notification settings - Fork 182
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
Unhandled Promise rejection: TextHighlighter is already enabled. #1501
Comments
This bug (or nuisance - as far as I can see, it's just a warning) doesn't show on my machine, so I need your help. Please add the attribute I suppose it's interesting to observe the calling function. The text highlighter is enabled twice, but I don't understand how that's possible. I suspect there's a text highlighter for each page, and maybe it's activated both for the text layer and for XFA forms. Does you PDF file use such a form? |
the particular pdf im using only has one page actually. After setting the breakpoint there i do see it get hit twice. The first time the value of textDivs and textContentItemsStr are both empty arrays and the enabled field is false. The second time the textDivs and textContentItemsStr are both filled with 119 element/strings and then the error gets thrown because enabled is already true |
I have to admit I'm not familiar with that part of the implementation of pdf.js. I'm just the guy providing an Angular wrapper for it. So I can't decide whether the empty arrays are OK or not. My gut says it sounds fishy, but that's just a guess. What about the stack trace - can you spot a difference there? Plus, I wonder if the bug has something to do with your PDF document. Here's a small selection of demo PDFs: https://github.com/stephanrauh/extended-pdf-viewer-showcase/tree/main/src/assets/pdfs. Does the bug happen with these PDF files, too? |
interestingly enough it does not seem to happen on a few of the pdfs with text that ive tried from that folder... really not sure whats going on there. Even more strange it does not happen to my document every time either. im not seeing anything else to indicate the issue in the stacktrace unfortunately |
im extremely unfamiliar with the expected format of PDFs, do you have any ideas as to what I could look for in our internal PDFs that may be causing this issue to happen? Also you mentioned this is a nuisance more than a bug as it is a warning, would it be possible to replace the Error throwing with a console warn instead? |
I'm almost as unfamiliar with the format of PDF files as you are! :) In any case, you can remove the error message yourself: https://pdfviewer.net/extended-pdf-viewer/filtering-console-log |
…if the text highlighter is initialized twice
…if the text highlighter is initialized twice
I've removed the error message. Now the code doesn't throw an exception. I don't think that's going to cause problems, but I'd appreciate your test (once I've published version 15.0.0-alpha.6). |
sure ill check it out once that version drops. interestingly enough im unable to see that error being logged from the log filter (which im currently using to filter out those warn messages i mentioned in another issue I brought up) |
The error message is thrown as an exception, so maybe it slips the attention of my filter implementation. Yesterday, Tim caught me by surprise when he released a new version of pdf.js, so I guess the final release of version 15 is delayed another few days. |
I've just published version 15.0.0-alpha.6. Two-way binding of forms is broken (#1516), but I guess that's not your use-case, so please run a test. |
…zed twice; updated to pdf.js 2.16 (default branch) and pdf.js 3.0 (bleeding edge branch); #1516 fix broken two-way binding of forms (work in progress)
No
No
Unfortunately the PDFs we are using contain confidential info so I cannot supply the PDF I am using but can supply the options im passing to the extended pdf viewer
Describe the bug
When opening the viewer with documents from my company I am seeing this error happen frequently (but not always)
Version info
Desktop (please complete the following information):
To Reproduce
Screenshots
The text was updated successfully, but these errors were encountered: