在Chrome PDF Viewer上隐藏/禁用下载按钮 [英] Hide/Disable download button on Chrome PDF Viewer

查看:716
本文介绍了在Chrome PDF Viewer上隐藏/禁用下载按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找隐藏或禁用Chrome PDF查看器中显示的下载按钮的方法。我已经使用fpdf的保护脚本禁用了打印按钮( http://www.fpdf。 org / en / script / script37.php ),但它对下载按钮没有帮助。 PDF目前正在新窗口中打开:

< console =truedata-babel =false>

window.open (URL,,resizable = yes,scrollbars = yes,titlebar = yes,width = 1024,height = 900,top = 10,left = 10);



我意识到这不会阻止任何有点知情的用户保存/打印PDF,但客户坚持这个安全措施。



如果我使用开发工具检查元素,并添加显示:无它做我想要的,但我不知道如何添加默认在打开的新窗口中打开。

解决方案

由于您将pdf文件直接传送到浏览器中,使用Adobe Reader ActiveX显示,可以防止文件下载,因为这些文件在下载到您的临时直接目录后显示ry?



因此,使用任何JavaScript库都是不可能的。



确保您的主PDF文件是通过为每个页面创建图像并通过自己的界面(html,flash等)将这些图像呈现给网络用户。

您可以使用 ImageMagick GhostScript



您可以通过 veryinteractivepeople



希望这会有所帮助。 (:

I'm looking for a way to hide or disable the download button that appears in the Chrome PDF viewer. I have disabled the print button using the protection script of fpdf(http://www.fpdf.org/en/script/script37.php), but it doesn't help with the download button. The PDF is currently being opened in a new window via :

window.open(URL, "", "resizable=yes, scrollbars=yes, titlebar=yes, width=1024, height=900, top=10, left=10");

I realize this won't stop any somewhat informed user from saving/printing the PDF, but the client is insisting on this "security measure".

If I inspect the element using Dev Tools and add display: none it does what I want, but I'm not sure how to add that by default in the new window that opens.

解决方案

Since you are delivering pdf file directly into the browser, displayed using Adobe Reader ActiveX, how can it be possible to prevent file download, since the files are displayed after downloaded into your temp directory?

So it is not possible using ANY JavaScript library.

The only way to secure your master PDF files is by creating Images for each page and present those to the user on the web via your own interface (html, flash etc).

You may use ImageMagick along with GhostScript for this.

You may go through veryinteractivepeople

Hope this helps. (:

这篇关于在Chrome PDF Viewer上隐藏/禁用下载按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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