Opening a PDF File from Asp.net page

Before I paste the code. I like to thank Longhorn for providing me the code in VB.NET for opening the pdf file. The code is given below:

  private void ReadPdfFile()
    {
        
string path = @"C:\Swift3D.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); 
        }

    }

powered by IMHO

Print | posted @ Sunday, September 18, 2005 11:59 PM

Twitter