In an asp.net web application, I am using the below code to read PDF file from the shared path and show it in a table td
tag using an iframe. This way it shows pdf like a thumbnail/ Preview. This is working for small pdf file sizes. But the iframe is showing empty for the pdf file size > 25mb( approx).
ImpersonationHelper.Impersonate(ConfigurationManager.AppSettings["Domain"], ConfigurationManager.AppSettings["UserName"], ConfigurationManager.AppSettings["Password"], delegate
{
FileBuffer = System.IO.File.ReadAllBytes(filepath);
if (FileBuffer != null)
{
if (filepathnew.Contains("pdf"))
{
string base64String = Convert.ToBase64String(FileBuffer, 0, FileBuffer.Length);
pdfUrl = "data:application/pdf;base64," + base64String;
}
}
});
string pdfSource = String.Empty;
pdfSource = "<iframe src=" + pdfUrl + " visible='false' style='overflow:hidden' width='400' height='400' scrolling='no' type='application/pdf' id='pdfPreview'></iframe>";
StringBuilder table = new StringBuilder();
table.Append("<td >" + pdfSource1 + "</td>");