I have an ASP.NET WebForms application (written in C#) that allows users to upload files using the FileUpload control.
What'd be great is if I could automatically generate thumbnails from files. Images such as JPG/PNG are trivial of course, but users will often upload .DOC and .PDF files - is there a way I can essentially convert .DOC and .PDF files to images so I can get a thumbnail?
I got an Issue where i need to upload the PDF file to the Server using a User interface and then get the thumbnail of the first page of the PDF and show it in a collection (All i need for the time being is a tool which can be used to get a Thumbnail of the Uploaded PDF). Is there any tools which will help us do. C# generate, get pdf thumbnail files for selected PDF pages. #region generated pdf file page's thumbnails with specified image size internal static void generatePdfPageThumbnailWithSpecifiedSize() { String inputFilePath = @'C: demo.pdf'; PDFDocument doc = new PDFDocument(inputFilePath); int pageIndex = 2;. A thumbnail is a small sized image. Creating a thumbnail using.NET is extremely simple. In this article, we will explore how to create a thumbnail image and display the thumbnail in our application.
Thanks!
For PDf you can try ABCPDF from websupergoo. With that you should be able to generate a thumbnail,Documentation link for creating a PNG from a PDF. http://www.websupergoo.com/helppdf8net/source/4-examples/19-rendering.htm
also for Doc, it is a little more complex, you are going to have to install the office application on the server that host the apps and from there manipulate the image.
Look at this article. It lets you extract the thumbnail image that Windows Explorer uses for Office documents and regular images.http://msdn.microsoft.com/en-us/library/aa289172.aspx
On paper the most hopeful approach would be to do so server side. So, if the file were uploaded, the server could generate a preview image.
On Windows, there would be a few options.
a) Windows Shell has a way to do it. The path is dangerous though.b) https://filepreviews.io/ Is a service that does it, but they charge.c) box is another service that does it.
Now on Linux, or even, perhaps, a Linux in a Windows subsystem, could do it with some command line utilities.
a) Convert the doc to pdf:
b) Then, get a bitmap of the first page of the pdf, use ghostscript. ghostscript also exists for .NET and Windows.
For PDF you may find my answer here: Generate a pdf thumbnail (open source/free)
Note that this one answer is the only that is legal without any additional software costs - some open source software comes at a hefty license if you don't use it according to their terms.
Also it should be easy to use this answer for the doc file - as far as I know OpenOffice generates such a thumbnail.

You can use GhostScriptWrapper for generating image thumbnails directly from pdf.You can get ghostScriptWrapper from here https://github.com/mephraim/ghostscriptsharp or you can include ghostscript dll from nuget package manager solution.
Client-side, I haven't found anything useful.
However, Server-side, there is the option of converting first .docx and .xlsx files to a temporary PDF file, and then create the thumbnail. Use Microsoft.Office.Interop for the first step, and then Microsoft.WindowsAPICodePack.Shell.ShellFile for the second step.
Here is an article that might help you out
I'm trying to create a content catalog program that is used to browse files. I want to show the thumbnail of the files like Explorer does in windows. How can I use C#.Net to extract the thumbnail that windows explorer shows into an instance of System.Drawing.Image?
I'm fairly certain I need to use this or something related to IExtractImage. Yet I'm pretty lost when it comes to doing anything with COM, pinvoke, interop etc..
Have a look at the accepted answer in this StackOverflow question:C# get thumbnail from file via windows api
The code you linked to at the vbaccelerator site is from 2003 and exhibits several memory management problems.