Generate Thumbnail Images from PDF Documents in .NET

The Download

Visual Studio.NET Solution

The project you can download has all the VB.NET code and the COM Interop DLL that was generated. Even though the application is actually a console application we still need System.Windows.Form as the clipboard dataformats are from there.

Use the app.config to set the input and output paths for the .pdf files and .png files respectively. By default it reads and write to C:\thumbnails\.

Output

Running the PDFThumbnail.exe console application will enumerate all the .pdf files in the directory specified in the .config file writing out a .png image of the first page.

Console output

Which we can see in the screenshot below.

Explorer view


Further Enhancements

Further improvements might be to:

  • Render directly to an off-screen bitmap rather than to the clipboard.
  • Remove the reliance on having a full version of Adobe Acrobat by using Ghostscript libraries instead.

One case we had was documents that could be viewed internally but were blocked due to compliance issues for external users, by designing different templates and rendering them with the page it was obviously the document was private further enhancing usuability, eg.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“If Java had true garbage collection, most programs would delete themselves upon execution.” - Robert Sewell