We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37126
    • 37 Posts
    Spent ages a while ago trying to get pdf thumbnails working on a site, then found that they can be created using phpthumbof exactly as you would for a jpeg or png. Don't know if that's just common knowledge but thought I'd share it for anyone that needs the same thing. Anyone got the same thing working with Filelister before?
      • 37042
      • 384 Posts
      Seriously? That's great news. Was told I needed a custom snippet for that so I guess we're not the only ones.
      Do you have any online examples?
        ...
        • 34926
        • 87 Posts
        Q: Can I make thumbnails from a PDF?
        A: Yes, as long as you have both ImageMagick and GhostScript
        installed. The AFPL version of GhostScript seems to work
        better than the GNU version (at least for me it does).
        http://www.imagemagick.org
        http://www.cs.wisc.edu/~ghost/
        You may want to use the "sfn" (Source Frame Number)
        parameter of phpThumb to specify which page to thumbnail.

        I would imagine it would be a case of:
        [[!phpthumbof? &input=`path/to/pdf.pdf` &options=`&w=128&h=128`]]
          • 37126
          • 37 Posts
          Yes that's pretty much it the only thing I added to that was &f=png as the jpeg thumbnails were rendering with black backgrounds and png allows for the background to be transparent. The host is a cpanel host, I'm guessing ghostscript must already be installed didn't make any special request.

          [[!phpthumbof? &input=`path/to/pdf.pdf` &options=`&w=128&h=128&f=png`]]