服务器生成的PDF而非在iframe aspx页面上显示的一些(但不是全部)电脑 [英] Server generated PDF not displaying in IFrame on aspx page on some (but not all )PCs

查看:169
本文介绍了服务器生成的PDF而非在iframe aspx页面上显示的一些(但不是全部)电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经有了一个网页的iframe(我们称之为该网页DocViewer.aspx),它被设置到另一页中的src。让我们呼吁其他页面DocContent.aspx

We've got an IFrame on a page (let's call that page DocViewer.aspx) the src of which is set to another page. Let's call that other page DocContent.aspx

ERE是在DocContent.aspx.vb页面加载速度:

ere's the page load on DocContent.aspx.vb:

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    'get pdf bytes from session
    Dim pdfBytes As Byte() = CType(Session("PDFBytes"), Byte())

    'remove pdf bytes from session
    Session.Remove("PDFBytes")

    With Response
        ' Set the response type to PDF
        .ClearHeaders()
        .Buffer = True
        .ContentType = "application/pdf"
        .AddHeader("Content-Disposition", "inline; filename=" & "midoc.pdf")


        .AddHeader("Content-Length", (pdfBytes.GetUpperBound(0) + 1).ToString)
        Response.OutputStream.Write(pdfBytes, 0, pdfBytes.Length)

        .End()
    End With ' response

End Sub

和这里的所有DocContent.aspx页它的荣耀:

and here's the DocContent.aspx page in all it's glory:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="DocContent" Inherits="OurCompany.OurNamespace.DocContent" %>

我们正在使用的IFrame的原因是alow我们举办PDF中也运行一些脚本,并且对一些控件(如特定条件得到满足,我们就弹出使用模态模态对话框页面对话框扩展,但我们已经关掉该行为关闭,问题仍然存在的)。不使用iframe是不是一个可行的解决方案,无论是。我检查了IE中的安全设置和他们都设置为允许dislayed的IFrame。

The reason we're using an IFrame is to alow us to host the PDF in a page that also runs some scripts and has some more controls on (if a certain condition is met, we pop up a modal dialog using the modal dialog extender ,but we've switched that behaviour off and the problem is still occuring). Not using an IFrame isn't a doable solution either. I've checked the security settings in IE and they're all set to allow IFrames to be dislayed.

这里的问题,那么 - 在一些测试电脑的页面显示PDF格式的罚款。别人我们只是得到一个空白页。

Here's the problem then - on some testers PCs the page displays the pdf fine. On others we just get a blank page.

刚刚看到这是不显示启动时升级到了IE7显示的机器。这不幸的是,没有办法了,因为我们要支持任何东西到IE5.5:(

Just seen a machine that wasn't displaying start displaying when it was upgraded to IE7. This unfortunately is not a solution as we have to support anything down to IE5.5 :(

我对任何人的想法都有。

I'd be super grateful for any ideas anybody has.

我还要提到的是,这些机器有导航类似于直接DocContent页面时(而不是在iframe中被托管),没有问题。

I should also mention that these machines have no trouble when navigating to a page similar to DocContent directly (rather than being hosted in an IFrame).

呵呵,感谢提前对你的帮助。

Oh and thanks in advance for your help.

推荐答案

这是可能的,这是行为不端的客户与他们的安装Adobe Acrobat Reader软件的问题。它有它是否应该出现在浏览器窗口或外部的内部设置。

It's possible that the clients which are misbehaving have problems with their installation of Adobe Acrobat Reader. It has settings for whether it should appear inside of a browser window or externally.

该解决方案可以是卸载Acrobat Reader,请重新启动,重新安装Acrobat Reader软件的默认设置一样简单。

The solution may be as simple as uninstalling Acrobat Reader, Rebooting, Reinstalling Acrobat Reader with the default settings.

这篇关于服务器生成的PDF而非在iframe aspx页面上显示的一些(但不是全部)电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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