Wednesday, February 3, 2010

How to write the PDF Binary files in C#.Net?

System.Net.WebClient client = new System.Net.WebClient();
Byte[] buffer = client.DownloadData("D:\\Kannabiran\\dotnet.pdf");
if (buffer != null)
{
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.AddHeader("Content-Type", "application/pdf");
Response.BinaryWrite(buffer);
Response.End();
}

No comments:

 
Feedback Form