如何在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.
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.