Last post May 28, 2014 01:52 AM by aspTN
May 26, 2014 03:46 AM|aspTN|LINK
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())
var base64Data = Convert.ToBase64String(ms.ToArray());
imgFile.Attributes.Add("src", "data:image/gif;base64," + base64Data);
imgFile.Visible = true;
Any help would be appriciated!!!
May 26, 2014 08:08 AM|PatriceSc|LINK
"Windows Explorer on the server" Do you mean showing the server disk from your client computer or do you mean using "Windows Explorer inside a server side session" ?
My first thought would be that you don't have an Adobe Reader on your server. To me the method you are using does use products that are registered as being able to generate thumbnails for this file format so if it is not installed on the server, it won't
be able to generate thumbnails.
May 26, 2014 09:22 AM|aspTN|LINK
Thanks a lot for your reply.
Windows Explorer On The Server I mean - when I connect to the server by remote desktop from my computer, I can see the files thumbnails in the folders.
Adobe Reader XI has already been installed on the server.- (and the thumbnails are shown there..)
What can be the solution?
May 28, 2014 01:52 AM|aspTN|LINK
I am still looking for a solution , didn't find one yet.
Maybe someone knows , instead of the code above-
How can I save the first page of pdf file as small image?
I found some solutions but none of them worked for me because I need c# code that works on
Windows Server 2008 R2