Today's Deals (in Amazon.com)

 Question:

imagefield - How can I convert first page of a pdf as its thumbnail?
  • Sheshkovsky

    I'm trying to build a document sharing site so I need to convert first page of each document as its thumbnail in a grid view. I've found some module like PDF-to-ImageField module, but unfortunately it has been released only for Drupal 6.

    Now what can I do? is there any Module to convert first page of each document (specially pdf and doc) to a thumbnail for drupal 7? or any other ways?

  •  Answers:

  • Jim Kirkpatrick

    Some people have started a Drupal 7 version, but it's nowhere near ready yet. If you can program for Drupal 7 and want to get involved, you could check out their Git repository and help them out.

    If you're not ready to start porting D6 modules to D7, you could try one of these options to build those thumbnails, then write a little snippet of code to attach them to your nodes in your imagefields:

    • Stack Overflow: How do I convert a PDF document to a preview image in PHP?
    • Webvamp: How-to create PDF preview images in PHP
  • mikewink

    I would like to add the PDFPreview module as an viable option. I use it in the exact same area as you for a bunch of document sharing sites and it works well. I tweaked it a little bit so that it works better in combination with image_styles, but beside of that its a nice little module that does what you want.

    Link: PDFPreview project page