ngx-extended-pdf-viewer icon indicating copy to clipboard operation
ngx-extended-pdf-viewer copied to clipboard

Display position is not aligned when selecting text in Firefox

Open myl1992 opened this issue 9 months ago • 4 comments

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

myl1992 avatar Apr 27 '24 03:04 myl1992

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.

stephanrauh avatar Apr 27 '24 20:04 stephanrauh

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: extend demo file in pdf.js: pdfjs

Version info: v19.7.1 Demo pdf link: https://github.com/mozilla/pdf.js/blob/master/web/compressed.tracemonkey-pldi-09.pdf

myl1992 avatar May 08 '24 23:05 myl1992

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: image

Screenshot with Firefox: image

stephanrauh avatar May 09 '24 20:05 stephanrauh

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~

myl1992 avatar May 10 '24 15:05 myl1992

I'm closing the ticket now. I hope you've managed to find the root problem in the meantime!

Best regards, Stephan

stephanrauh avatar May 25 '24 10:05 stephanrauh