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.
Which we can see in the screenshot below.
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.
Comments