The PDF created by the server does not appear in the IFrame on the aspx page on some (but not all) PCs

We have an IFrame on the page (call this page DocViewer.aspx) whose src is set to another page. Let me call this other page DocContent.aspx

when the DocContent.aspx.vb page loads:

    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

and here is the DocContent.aspx page in all this glory:

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

, IFrame, , PDF , ( , , ). IFrame . IE, , IFrames.

- PDF . .

, , ​​ IE7. , , - IE5.5: (

, - .

, , DocContent ( , IFrame).

, .

+3
2

, , , Adobe Acrobat Reader. , .

, Acrobat Reader, , Acrobat Reader .

+2

, . , , , , . , , , ( , , ).

0

Source: https://habr.com/ru/post/1705644/


All Articles