1 Reply Latest reply on Jan 13, 2012 12:55 PM by MiaLoren

    Adobe Reader 10.1.1 displaying blank screen when pdf file is streamed to Internet Explorer ASP .Net

    RajendraMeghwal

      Adobe Reader 10.1.1 displaying blank screen when pdf file is streamed to Internet Explorer ASP .Net

       

      I have an asp.net application which dynamically creates pdf stream and send it to the client. If the client machine have adobe reader version 10.1.1 the browser sometimes show blank screen.

      The client machines which have adobe reader version less than 10.1.1 does show the pdf file.

       

      I am using the following code to generate pdf on the fly -  ReceiptImage is a byte array

       

      Response.ClearContent();

      Response.ClearHeaders();

      Response.Buffer = true;

       

      Response.ContentType = "application/pdf";

      Response.Charset = "";

      Response.AppendHeader("Accept-Ranges", "none");

      Response.AddHeader("content-disposition", "inline");

      Response.AddHeader("Cache-control", "max-age=5");

      Response.AddHeader("content-length", ReceiptImage.Length.ToString());

       

      Response.OutputStream.Write(ReceiptImage, 0, ReceiptImage.Length);

       

      I have visited many forums and tried all the solutions mentioned but nothing seems working. 2 out of 10 times it still show blank screen. I am opening the asp.net page in a new window after clicking a link. As the window is named if i refresh the window or again click the link without closing the window the asp.net page shows the pdf.