I am using the buffer to write the pdf file to the page in asp.net, I wonder its overwriting the html DOM elements. Can anyone help me out how can i render the pdf on the page. Even i tried using the Web user control. It does but shows the scroll bar at the side.
My target is to render the pdf file in the page and fire the window.print() function in javascript.
Please have a look at the given code below.
string path = Session["fullname"].ToString();
System.Net.WebClient client = new System.Net.WebClient();
Byte[] buffer = client.DownloadData(path);
if (buffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
Response.Flush();
}
if ((System.IO.File.Exists(path)))
{
System.IO.File.Delete(path);
}
Thanks in Advanced.