How to get highlighted text to pdf via JS?

  • 0
    Hello everyone, the situation is like this:

    there is a page, a pdf file is uploaded to it via & lt; embed & gt; or & lt; iframe & gt; , you can select text there, the pdf itself is displayed perfectly, but window.getSelection () does not works. Googled this question - it turned out that this cannot be done, tk. Thus, another page of another "window" is loaded through an iframe or embed, maybe someone came across a similar, how can I get this selected text from a window with pdf?
    JavaScript Adrian Gilbert, Apr 2, 2019

  • 1 Answers
  • 0
    Maybe something like this?

    document.querySelector("iframe").window.getSelection*(
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!