aspx页面中的pdf文件

编程入门 行业动态 更新时间:2024-10-20 09:24:22
本文介绍了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文件

本文发布于:2023-11-10 16:08:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1575837.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:页面   文件   aspx   pdf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!