在没有打开/保存对话框的情况下在Acrobat阅读器中打开PDF文件
问题描述:
点击按钮我已经编写了一个代码来打开pdf文件,该文件正常工作只有我想要的东西在acrobat阅读器中打开而不是要求打开/保存对话框。
我用过程.start()但它不适用于IIS。我不想在另一个浏览器中。
和
我可以禁用保存,复制,打印pdf文件。
On button click I had written a code to open pdf file which is working properly only the thing I want is open in acrobat reader instead of asking open/save dialog box .
I had used process.start() but it is not working on IIS . I don't want in another browser .
and
Can I disable save,copy,print of pdf file.
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + filepath);
Response.TransmitFile(filepath);
Response.End();
答
打开文件(pdf / office / image),没有打开或保存对话框 [ ^ ]
http://forums.asp.net/t/1675266.aspx [ ^ ]
确保在响应中添加以下标题:
Make sure you add the following headers in the reponse:
Content-type: application/pdf<br />
Content-Disposition: inline; filename="yourfile.pdf"
实际打开阅读器中的pdf仍然取决于客户端浏览器。取决于与pdf相关联的程序(如果有)并且用户没有禁用它。
祝你好运!
Actual opening the pdf in a reader is still up to the client browser. Depending on what program is associated with pdf (if any) and the user didn't disable it.
Good luck!