Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would you convert any document to a preview image?

I am using .NET and am looking for a way to convert just about any document into a preview image. I say any, but the priorities are Office Documents, PDF, and most image files.

I would assume that I can somehow build upon the Windows Explorer's ability to preview documents... but I do not know how.

What would you do?

like image 650
Jason Avatar asked May 12 '09 04:05

Jason


1 Answers

On Windows Vista you can use the preview handler API to either write a preview handler or use a preview handler to display a preview in your application. The link contains code that shows you how. Here's an example Photoshop preview handler that also goes over some background information that might be useful.

Finally, here is an example that uses C#. It's a WPF application that uses the C# class COMStream to get the preview data from a preview handler (which is an unmanaged COM object).

like image 65
Naaff Avatar answered Nov 15 '22 06:11

Naaff