Library tutorials & articles

Generate Thumbnail Images from PDF Documents in .NET

Wrapping Up

Points of Interest

The Adobe Acrobat 5.0 SDK is not the greatest written documentation but most information is there if you dig a little.

If running under an NT service account the screen resolution and depth make a difference; for example if your server is only set for 256 colours in 640 x 480, and if the console application is run via the service it will not be able to render 24-bit colour thumbnails. I've seen the same effect when using charting controls from ASP, where the production IIS servers had low screen resolutions set and the colour-depth of the charts was low.

Also, if running in a batch on a server you should check the terms of the Acrobat license agreement to whether you are allowed to run the Adobe Acrobat application in a server-type process.

The images are about 2-3Kb in size and for about 3Gb of documents the thumbnails would take an additional 60MB - so storage requirements are not excessive. The actual time to generate thumbnails for thousands of documents would be a few hours, as Acrobat needs to load each document as well as the rendering to the clipboard, and the .NET bitmap scaling, etc.

References

  • Microsoft .NET Framework 1.1 documentation
  • Chris Sells' web site for the transparency example code
  • Adobe Acrobat 5.0 SDK documentation and examples
  • Code Complete Second Edition for the example PDF document (which I hope Steve doesn't mind me including and which I can totally recommend even nearly ten years since it was first published)

Conclusion

This article has shown how to manipulate PDF documents using the Acrobat SDK and combine images using the .NET framework.

At first it can be quite daunting trying to find good information on working with PDF documents programmatically, although there are now a number of good commercial components which hide a lot of the underlying postscript complexities.

I originally wrote this utility in Visual Basic 6 using a third-party imaging components, but now it is easier to share the code using the .NET framework. Especially as the complex imaging and manipulation can now be done with a few simple statements.

Thanks and I hope you enjoyed reading this article; I'd be interested to hear if people found it useful.

This article was originally published at http://www.codeproject.com/dotnet/pdfthumbnail.asp

Comments

  1. 04 Nov 2006 at 12:20

    Hai,

             This is very use full and working exactly... But i cant use it for an Online application.....Is there any way to create thumbnail for PDF in online application....Or else Is there any possibilites to call the Existing Console application from Online application

     

    Thanks a lot

  2. 10 Jan 2006 at 08:42

    I do not seem to be able to download the v5 SDK, the only one on the link provided is the UNIX sdk

  3. 01 Jan 1999 at 00:00

    This thread is for discussions of Generate Thumbnail Images from PDF Documents in .NET.

Leave a comment

Sign in or Join us (it's free).

Jonathan Hodgson

Related discussion

Related podcasts

  • Interview Dragos Manolescua

    Podcast (MP3): Download Hosts: Markus Guests: Dragos Manolescu Recording venue: JAOO 2006 In this Episode we discuss software architecture evaluation with Dragos Manolescu, an architect at Microsoft's patterns & practices group. We start off the discussion by...

Events coming up

  • Dec 9

    Los Angeles Hadoop December Meetup

    Santa Monica, United States

    Information on this weeks presentation: About The Presenter: Brian is a long-time Java developer and enterprise architect (lots of ESB and service-oriented projects), with happenstantial real-world cloud experience in the past few years including: developing a custom, open-source storage cloud for the NIH; cloud-based image processing and computing research for Canon.

We'd love to hear what you think! Submit ideas or give us feedback