protected void Page_Load(object sender, EventArgs e)
{
ReadPdfFile();
}
private void ReadPdfFile()
{
string path = @"C:\Documents and Settings\sujoy\Desktop\Read-Data-From-Excel\App_Data\Test.pdf";
WebClient client = new WebClient();
Byte[] buffer = client.DownloadData(path);
if (buffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
}
}
{
ReadPdfFile();
}
private void ReadPdfFile()
{
string path = @"C:\Documents and Settings\sujoy\Desktop\Read-Data-From-Excel\App_Data\Test.pdf";
WebClient client = new WebClient();
Byte[] buffer = client.DownloadData(path);
if (buffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
}
}