PDF Previewing and viewing

Dale Marshall picture Dale Marshall · Feb 12, 2009 · Viewed 16.2k times · Source

I'm creating a document viewing web application. You log in and it takes you to a screen where you have all your docs listed on the left. I want to make it so that when you roll over a document a preview of the document shows up on the right. From there you can click on it for a full view and printing capabilities. I'm not asking how to do all that but I'm wondering what the best way would be to go about rendering the preview of the document. The documents are all going to be pdfs and stored on a server. I'm working in asp.net 3.5 mvc in visual studios 2008.

Answer

Renaud Bompuis picture Renaud Bompuis · Feb 15, 2009

For creating the PDF preview, first have a look at some other discussions on the subject on StackOverflow:

If these don't answer your question, you can try a couple more things:

  • You can get a commercial renderer (PDFViewForNet, PDFRasterizer.NET, ABCPDF, ActivePDF, ...).
    Most are fairly expensive though, especially if all you care about is making thumbnails.
  • There is a CodeProject article that shows how to use the Adobe ActiveX, but it may be out of date, easily broken by new releases and its legality is murky.
  • Install GhostScript on the server and request rendered thumbnails of any page from it.
    I did a small project that you will find on the Developer Express forums as an attachment.
    Be careful of the license requirements for GhostScript through.
    I use it for an internal software and it's working pretty well.

Hope this helps.