Answer the question
In order to leave comments, you need to log in
How to get selected text in pdf via JS?
Hello everyone, the situation is this:
there is a page, a pdf file is loaded onto it through <embed>
or <iframe>
, you can select text there, the pdf itself is displayed fine, but window.getSelection() does not work. I googled this question - it turned out that this can not be done, tk. thus, another page of another "window" is loaded through iframe or embed, can someone come across a similar one, how can I get this selected text from a window with pdf?
Answer the question
In order to leave comments, you need to log in
Maybe something like this?
document.querySelector("iframe").window.getSelection*(
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question