Closed Elon-Mask12 closed 6 months ago
Thanks for the kind words.
Unfortunately, I was aware of this annoying bug. This issue is due to a long-standing bug in PDF.js that seems to be chromium-specific (https://github.com/mozilla/pdf.js/issues/9843). Fixes for it on the original react-pdf-highlighter encountered various platform-dependent issues (https://github.com/agentcooper/react-pdf-highlighter/issues/246#issuecomment-1670829314).
That said, trying to fix this bug is a priority for the next release of this fork (7.1.0). If I can't get anything working, I will probably revert to an earlier version of PDF.js where enhanceTextSelection
was still available.
Hey, any updates? 👀
I was able to get it working by changing pdfjs-dist version to "2.16.105" and also the "DEFAULT_WORKER_SRC" to use the same version. and change import of PdfDocumentProxy
to import type { PDFDocumentProxy } from "pdfjs-dist";
But by doing that, the highlights are no longer visible. : (
I wasn't able to come up with a reasonable fix for this that didn't balloon the complexity of the project, so I've decided to rollback the PDF.js version.
The highlights not being visible was due to textLayer
having its property textLayerDiv
renamed to div
between versions.
Updates are on the 7.1.0 branch which I hope to release shortly.
Holy shit! Thanks a fuckton. sharing this w. my friends <3<3
Absolutely love the project, loved the og library as well. Just wanna let u know of this one thing thats bothering me. The main reason why i chose react-pdf-highlighter for my projects over react-pdf or something is cause of this one bug . i believe its caused due the new version of some deps, but itd be nice if u could leave the deps in the old version, cause this is super annoying imo. Thanks. <3