aspx页面中的pdf文件 [英] pdf file in aspx page

查看:580
本文介绍了aspx页面中的pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在aspx页面中显示pdf文件。

- >当我点击查看按钮时,pdf文件会显示

当我点击下载按钮时, pdf文件将被下载。

我必须为此做些什么。

i have to display pdf file in aspx page.
->when i click on view button pdf file will be display
when i click on download button ,pdf file will be downloaded.
what i have to do for this.

推荐答案





如果特定浏览器支持PDF(如Chrome一样),默认情况下可以配置它来显示文件而不是下载文件。



否则响应是 HTML 所以你不能这样做,要么创建html来显示,要么尝试不同的方法(而不是在浏览器中显示pdf文件)



干杯,

Edo
Hi,

If a specific browser supports PDF (like Chrome does) it can be configured by default to display the file instead of downloading it.

otherwise the response is HTML so you can't just do that, either you create html to display or try a different approach (than showing the pdf file in the browser)

Cheers,
Edo


不能这样做,



一个替代方案是zip,pdf通过代码下载链接。有很多方法可以用来压缩pdf文件。
can't just do that,

An alternate is zip that pdf via code for download link. there are lot of methods on wen to zip you pdf file.


要强制Web浏览器显示另存为选项,您必须指定 application / octet-stream 内容类型。
To force the web browser to display "Save As" option, you have to specify "application/octet-stream" Content-type.


这篇关于aspx页面中的pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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