如何只显示PDF文件,不让观众下载PDF文件? [英] How do I just display PDF file and don't let viewer to download the PDF file?

查看:297
本文介绍了如何只显示PDF文件,不让观众下载PDF文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我想构建一个Web应用程序,我想在其中向用户显示PDF文件但不允许用户下载这些PDF文件。



你能协助我做这个吗?

Hello,

I want to build an web application in which I want to display PDF file to user but don't let user to download these PDF file.

Can you assist me for doing this?

推荐答案

然后阅读PDF文件内容并显示在div或某个容器中的网页。
Then read the PDF file contents and show in the Web Page in a div or some container.


如果是这种情况,则无法将PDF文件发送到客户端。您的服务器端代码必须拍摄PDF的每个页面的图片(呈现为图像)并发送图像以显示在客户端上。
If that's the case you can't send the PDF file to the client. Your server-side code has to take a "picture" of each page of the PDF (rendered as an image) and send the image to be displayed on the client.


这篇关于如何只显示PDF文件,不让观众下载PDF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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