I am trying to display PDF thumbnails on asp.net website.
When I am running the website on my local mechine from visual studio debug- the thumbnail images are displayed (tiff or pdf).
When I run the site on the server after publishing it (Windows Server 2008 R2, ServicePack1, 64bit) - the tiff thumbnails are displayed as expected, but PDF thumbnails displayed as AdobeReader icons (not the first page of the PDF file).
Windows Explorer on the server displayes the PDF thumbnails correctly.
The code I write for displaying thumbnails(using WindowsAPICodePack):
using (ShellFile shellFile = ShellFile.FromFilePath(curPath))
{
using (Bitmap shellThumb = shellFile.Thumbnail.MediumBitmap)
{
using (MemoryStream ms = new MemoryStream())
{
shellThumb.Save(ms, ImageFormat.Gif);
var base64Data = Convert.ToBase64String(ms.ToArray());
imgFile.Attributes.Add("src", "data:image/gif;base64," + base64Data);
imgFile.Visible = true;
}
}
}
Any help would be appriciated!!!