fonol / anki-search-inside-add-card

An add-on providing full-text-search and PDF reading functionality to Anki's Add card dialog
https://ankiweb.net/shared/info/1781298089
GNU Affero General Public License v3.0
178 stars 24 forks source link

Problems with selecting text in PDFs #95

Open An-png opened 4 years ago

An-png commented 4 years ago

When there are titles, this addon struggles with trying to select text.

Here is an attached video:

incremental_reading_selcting_problems.mp4.zip

NOTE: while not demonstrated in the video, this problem doesn't occur with firefox's pdf.js either.

fonol commented 4 years ago

I also noticed that, but only for some pdfs, and it doesn't seem to be limited on titles, I sometimes observed it at longer breaks between text. I guess it has can be fixed with some more tweaking of the pdf.js textlayer. But no idea what exactly is causing it. Will keep an eye on it.

imagovernmentman commented 4 years ago

Hi. I have a Mac and I'm also struggling selecting texts in the pdf. The hotkeys don't seem to be working.

fonol commented 4 years ago

Hi, could you describe a bit more in detail, what shortcuts are not working exactly?

An-png commented 4 years ago

I guess it has can be fixed with some more tweaking of the pdf.js textlayer. But no idea what exactly is causing it. Will keep an eye on it.

Doesn't seem like it. Every PDF selecting related issue I get doesn't happen in pdf.js in Firefox. I opened the same wikipedia PDF that I was having problems with in this addon in Firefox. Then opening inspect element, I copied all the code from viewer.css into textlayer.css for this addon.

That didn't work. Then I tried only copied the copy which contained .textlayer , that didn't fix the problem. So it is something about how the addon handles PDF text, but it doesn't seem to be related to the textlayer, as Firefox's textlayer works fine in Firefox, but it doesn't fix the problem in the addon.

ehsanq1999 commented 4 years ago

RTL I have same problem copy/paste text rtl words is nice but it is select also text up or down of wanted text (inaccurate) another proplem after paste it . it is black words with black background ! so you cant read anything only after change background color

fonol commented 4 years ago

@An-png to be fair, you'd have to compare with pdf.js in Chrome and not with firefox.

@ehsanq1999 Is the selection always inaccurate or only sometimes? For the pasting, have you enabled Paste without Shift key strips formatting in Anki's settings?