View Pdf on browser using

Task: View Pdf on browser using

Description: Here I show how we can view the pdf file on browser using and c#.

using System.Net;
public void viewebook(string pdf_filepath)
    string FilePath = Server.MapPath(pdf_filepath);
    WebClient User = new WebClient();
    Byte[] FileBuffer = User.DownloadData(FilePath);
    if (FileBuffer != null)
        Response.ContentType = "application/pdf";
        Response.AddHeader("content-length", FileBuffer.Length.ToString());


No comments:

Post a Comment