leocharre has asked for the wisdom of the Perl Monks concerning the following question:

I have a pdf file with 5 pages. I want to get a thumbnail of each page for display in a browser.

I'm not finding much in the search or in cpan.

Anybody have experience with this? Where should I look to begin to solve this?

This one works in a funny 1999 kind of way: thumbpdf

Replies are listed 'Best First'.
Re: pdf thumbnail?
by friedo (Prior) on May 01, 2007 at 16:31 UTC
    You can use Image::Magick to open the PDF and output a small GIF of each page.
      Holy cow!
      convert ./myfile.pdf ./myfile.gif
      Makes one thumb of the first page.
      convert ./myfile.pdf ./myfile.jpg
      Makes a thumbnail of each page. They suck though. Hmm.
        I'm not sure how to select a specific page from a pdf, but this is what I use to convert single-page pdfs to jpgs:
        convert -colorspace rgb input.pdf -antialias -quality 60 output.jpg
        You really MUST use -antialias, and if you're converting CYMK pdfs to jpgs for the web, you really should also use the -colorspace rgb option, since many browsers suck at CYMK jpgs.

        Actually your first example makes an animated gif out of the pdf. Look at ImageMagick's documentation for thumbnail and explore some of the other options to deal with odd page sizes.
Re: pdf thumbnail?
by dewey (Pilgrim) on May 01, 2007 at 17:06 UTC
    Not a Perl solution, but I use evince-thumbnailer (I'm on Ubuntu Linux, not sure where else it works). Hope that helps.

    Update: Oops, I don't think this will get you shots of each page... well, good luck anyway.

    ~dewey