如何在iframe中禁用PDF工具栏下载按钮 [英] How to disable pdf toolbar download button in iframe

查看:2628
本文介绍了如何在iframe中禁用PDF工具栏下载按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web服务,该服务将返回给定文档ID的pdf流,并将内容类型设置为application/pdf,并将输出内容写到IFRAME到此为止,我完成并确定! 我的问题是: 我的要求是在IFRAME中禁用pdf下载工具栏按钮,是否可以使用JavaScript或j查询禁用​​PDF工具栏按钮, 我尝试过这样的事情:

I have a web service which will return pdf stream for a given document id and I will set the content type to application/pdf and write the out put to IFRAME upto this point I am done and OK! My problem is : My requirement is to disable the pdf download toolbar button in IFRAME, is there any way using JavaScript or j query to disable the PDF toolbar buttons, i tried some thing like this:

<iframe src="view/1.pdf?page=hsn#toolbar=0" width="875" height="95%" id="iframe11">
     <p>Your browser does not support iframes.</p>
     </iframe>

我尝试为iframe标记设置工具栏= 0,但这确实可行. 任何人都可以告诉我如何实现此目标?

I tried setting toolbar=0 for iframe tag but it dint work. an anyone please tell me how to achieve this ?

推荐答案

使用embed标签代替iframe标签:

Use embed tag instead iframe tag:

<embed src="http://localhost/yourpdf.pdf#toolbar=0" style="width:600px; height:500px;">

这篇关于如何在iframe中禁用PDF工具栏下载按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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