如何在iframe中打开PDF文件?在IE中没有PDF查看器 [英] How to open a PDF file in an iframe? Without PDF viewer in IE

查看:1232
本文介绍了如何在iframe中打开PDF文件?在IE中没有PDF查看器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Response.ContentType =Application / pdf;

Response.TransmitFile(pdfReport.Location + pdfReport.FileName);



在IE浏览器中禁用打开或保存对话框提示并查看标签与我们的PDF查看器插件。



问题流式传输PDF文件到IE浏览器 - 没有pdf插件在没有pdf查看器插件的Transmitfile中。



提前致谢。



< b>我有什么试过:< / b>



if((Request.Browser.Type.Contains(InternetExplorer)))

{

Response.AppendHeader(Content-Disposition,FirstCloseReport; filename =+ pdfReport.FileName);

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.ContentType =application / pdf;

Response.Write(pdfReport .Location + pdfReport.FileName);

Response.Flush();

Response.End();

}

Response.End();

Response.ContentType = "Application/pdf";
Response.TransmitFile(pdfReport.Location + pdfReport.FileName);

In IE browser to disable the Open or Save dialogue prompt and view to tag withour PDF Viewer plugin.

Problem Streaming PDF File to IE Browsers-does not have the pdf pluggin in Transmitfile without pdf viewer pluggin.

Thanks in advance.

<b>What I have tried:</b>

if ((Request.Browser.Type.Contains("InternetExplorer")))
{
Response.AppendHeader("Content-Disposition", "FirstCloseReport; filename=" + pdfReport.FileName);
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/pdf";
Response.Write(pdfReport.Location + pdfReport.FileName);
Response.Flush();
Response.End();
}
Response.End();

推荐答案

PDF.js [ ^ ]



它与Firefox内置的PDF查看器相同。



PDF.js[^]

It's the same PDF viewer that's built in to Firefox.

Quote:

Response.Write(pdfReport.Location + pdfReport.FileName);



那将要写响应的字符串报告文件的路径。该字符串不是有效的PDF文件。您可能打算使用 WriteFile [ ^ ]或 TransmitFile [ ^ ]而不是。


That's going to write a string to the response with the path of the report file. That string is not a valid PDF file. You probably meant to use either WriteFile[^] or TransmitFile[^] instead.


这篇关于如何在iframe中打开PDF文件?在IE中没有PDF查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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