Renjith V S

Renjith V S

  • NA
  • 9
  • 1.7k

Pdf is not downloaded in correct format in mobile devices?

May 12 2015 12:28 AM
Hi,
I have created a pdf file using pdf Sharp in my project. The created pdf is been downloaded also by the clients. It works fine in desktop browsers, but it doesn't be in correct format in some mobile device browsers such as iphone,ipad,android, windows phone etc.

I have tried this code
Hide Copy Code
public void download(string fpath)
{
// string fileName = "detailed_syllabus.pdf";
Response.ClearContent();
FileInfo updateFile = new FileInfo(fpath);
Response.ContentType = "application/octet-stream";
Response.AddHeader("content-disposition", "attachment;filename=\"" + Path.GetFileName(updateFile.FullName) + "\"");
Response.AddHeader("content-length", updateFile.Length.ToString());
Response.TransmitFile(updateFile.FullName);
Response.Flush();
}