ngx-extended-pdf-viewer
ngx-extended-pdf-viewer copied to clipboard
Display position is not aligned when selecting text in Firefox
Hello, I am using the text selection tool in different browsers with ngx-extended-pdf-viewer, the position of the selected text displayed in Firefox is significantly different from the actual location, but it works fine in Google Chrome.
text selection in firefox:
text selection in google chrome:
Version info: v19.7.1 Demo pdf link: https://arxiv.org/pdf/1402.7022.pdf
I'm not sure if this is an issue with pdf.js, please help me take a look. Thank you
You can open your file in https://mozilla.github.io/pdf.js/web/viewer.html to find out whether it's a pdf.js problem or my problem.
I opened the pdf.js demo file in Firefox browser and compared it with the presentation of pdf.js
demo file in ngx-extended-pdf-viewer:
demo file in pdf.js:
Version info: v19.7.1 Demo pdf link: https://github.com/mozilla/pdf.js/blob/master/web/compressed.tracemonkey-pldi-09.pdf
That might shed some light on the mystery. I've tried to reproduce your issue in the showcase, and it works fine - see the screenshot. Can you open the tracemonkey file on https://pdfviewer.net and confirm that, please?
If the selection is correct on https://pdfviewer.net, but not in your application, than your CSS files are causing the problem. This kind of problems is always a bit hard to hunt down. Compare the CSS rules of the text layer in both projects using the Chrome developer tools. With some patience, you'll find the difference, and you'll be able to fix it.
If so, please tell me, so I know I can safely close the ticket.
Screenshot with Chrome:
Screenshot with Firefox:
You are right, it works fine in https://pdfviewer.net/. I think it may be due to some css conflicts caused by other introduced components. Next, I need to do some checks. Thank you very much~
I'm closing the ticket now. I hope you've managed to find the root problem in the meantime!
Best regards, Stephan