PDA

View Full Version : Responce pdf



Aharond
6 Oct 2011, 2:08 AM
I am trying to open a dynamic pdf file inside an iframe (an aspx file with a pdf binary response)
This works fine in desktop browsers (like Chrome, Safari, Safari iphone emulator, etc...) however it doesn't work very well on normal devices

In apple devices (iPod/iPad/iPhone) pdf is shown but i can not zoom it/scroll it.
In android the pdf is not show at all.

here is the sample:

server side c# code:
myPage.aspx.cs

Response.Buffer = true;
Response.Clear();
Response.ClearHeaders();
Response.ContentType = "Application/pdf";
Response.AppendHeader("Content-disposition", "inline; filename=myname.pdf");
Response.AppendHeader("Accept-Ranges", "none");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.BinaryWrite(byteArray);
Response.Flush();
Response.End();
client side:
......
var mypdfIFrame = "<iframe id='myIFrame' src='myPage.aspx' style='width:100%;height:100%;' frameborder='0'></iframe>"
var iframePanel = new Ext.Panel({layout: 'fit'});

....

iframePanel.update(mypdfIFrame);

Is this a known problem ?

thanks