是否可以提取用户在pdf中选择的文本? [英] Is it possible to extract the text selected by the user in a pdf?

查看:99
本文介绍了是否可以提取用户在pdf中选择的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了这个帖子,它解释了如何从中提取文本一个PDF在JavaScript中,但我想知道是否有可能提取只有用户选择的文本。

不能。



除非JavaScript呈现器(as-in,pdf.js)呈现PDF,否则浏览器的javascript无法访问PDF。



这是因为它是由浏览器插件呈现的,故意不允许javascript访问。



您的文章标有google-chrome-extension和google-chrome,但您的问题没有提及这些。您可能不会提出具体的问题。


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.

解决方案

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.

这篇关于是否可以提取用户在pdf中选择的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆