views:

403

answers:

2

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?

+2  A: 

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).

Naaff
A: 

As a variant w/o COM - send any document to internal virtual windows printer (works in WinXP SP3 and higher) and preview received XPS-files.

Merl