views:

3547

answers:

6

I've used a tool from Aspose (Aspose.PDF.kit) to generate a JPG thumbnail on the fly of a PDF for a .NET application. This works great, but what kind of other alternatives are there? Codeproject.com has this tutorial, but it requires you to have the full version of Acrobat.

Is there an open source alternative that's geared for ASP.NET?

A: 

I absolutely despise working with PDF documents. But when I absolutely have to, I have been using iTextSharp. It has quite a bit of functionality, the API is fairly well documented, and it is theoretically free. Though to use it effectively it helps if you get the book that they push on their website. I'm not certain if you can easily make thumbnails with it, but it has worked for me in generating and manipulating PDFs on every project I've worked on so far.

stephenbayer
I've seen where forums talk about using JPedal to dynamically generate a thumbnail, but not for iTextSharp. I saw where you can import an image, of course, but not export a JPG representation. Can you specificy where in the API to look? Thanks!
Anjisan
A: 

I wrote some .NET code once that wrapped GhostView and generated TIFFs--which could then easily be used to generate thumbnails. You can check out the code here. The function processAndInsertLoan contains the code that actually kicks of the GhostView process and catches the processing output. You should be able to salvage something from that if you so choose.

theraccoonbear
A: 

You can generate a bitmap using the COM interface to the Windows Shell and calling IExtractImage(). I don't have C# code, but I wrote a function in C++ that does this successfully. The Windows shell doesn't depend on the Acrobat SDK to generate the thumbnail, but it might depend on your having the free Acrobat Reader installed on your machine.

Here's link some code written in Delphi that provides that functionality.

http://www.delphi3000.com/articles/article_3806.asp?SK=

Kluge
+2  A: 

Using Itext to create Thumbnails of PDFS

http://threebit.net/mail-archive/itext-questions/msg00436.html

I would recommend iTextSharp so you don't need the java redistributable

Mike
I think this code sample is using bits from JPedal. The PdfDecoder class isn't part of iTextSharp. Maybe it got rolled into iText and never got ported to iTextSharp?
CodeToaster
A: 

I will be testing this component. Its free and their online demo looks compelling: http://www.tallcomponents.com/pdfthumbnail-overview.aspx

Robert