Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, November 7, 2017 11:27 AM
In Edge (as in any browser) you can manipulate the content of webpages with JavaScript.
Edge also allows you to view PDFs.
I found out yesterday on an Adobe forum, that other browsers, like Chrome, allow for a PDF reader add-in that allows JavaScript to manipulate PDFs (for instance, you can get the content of a set of words that the user highlighted). The catch is that the JavaScript is part of the reader, not part of the browser. So the information (as far as I know) can't be shared with a website.
So I'm guessing the answer to this question is 'no', but I'll ask it. Is there any way to obtain text that the user highlighted in a PDF, when that PDF is shown in Microsoft Edge? Is there any way for JavaScript to interact with that PDF?
Thanks
All replies (1)
Wednesday, November 8, 2017 2:32 AM ✅Answered
Your guess is correct.
>>Is there any way to obtain text that the user highlighted in a PDF?
No, I don’t see any official blog and document talking or indicating this point.
>>Is there any way for JavaScript to interact with that PDF
No, the JavaScript you are trying to run only works in Adobe Acrobat and Reader and a few other desktop PDF viewers and one mobile PDF viewer that I'm aware of. The code doesn't work in Edge because Edge has its own built-in PDF viewer.
In short, you just can't count on the right viewer/browser/OS combo to be in place to run any JavaScript in the PDF. The PDF viewer built into Edge doesn't execute the JavaScript embedded in the PDF.
Please understand, achieve your goal in Chrome, it’s easy for you.
Regards
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].