Is it possible to extract the text selected by the user in a pdf?

允我心安 提交于 2019-12-25 11:33:15

问题


I have found this post that explains how to extract the text from a pdf in javascript, but I would like to know if it's possible to extract only the text selected by the user.


回答1:


You can not.

The PDF, unless it's being rendered by a javascript renderer (as-in, pdf.js), can not be accessed at all by the browser's javascript.

This is because it's being rendered by a browser plugin that the javascript is intentionally not allowed to access.

Your post is tagged with "google-chrome-extension" and "google-chrome" but your question does not mention these. You might not be asking a specific enough question.



来源:https://stackoverflow.com/questions/17774634/is-it-possible-to-extract-the-text-selected-by-the-user-in-a-pdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!