coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: stevepaugh on March 27, 2005, 08:30:20 AM

Title: PDF thumbnail from first page of PDF
Post by: stevepaugh on March 27, 2005, 08:30:20 AM
Is there a way to create thumbnails for PDFs dynamically from the first page of the PDF?
In other words, I would like the first page of a PDF to show up instead of the generic PDF file icon and I would like it to be generated upon upload of PDF file.
Is there anyway to do this?
Thanks!  :)
Title: Re: PDF thumbnail from first page of PDF
Post by: Tranz on March 27, 2005, 08:36:37 AM
seems possible. http://www.php.net/manual/en/function.pdf-add-thumbnail.php

Just need someone to code it.

edit: Or maybe it's talking about something else
Title: Re: PDF thumbnail from first page of PDF
Post by: stevepaugh on March 27, 2005, 09:32:21 AM
this is excatly what I want to do. http://view.samurajdata.se/

I think the something like the following code might work well to be intergrated in but I'm not sure how to do it
*****************from above listed url source code in render.sh in GPLed download**************


   # pdf or ps

   #after download - convert to pcx
   echo "Converting ps or pdf..."
   nice /usr/bin/ghostscript -sDEVICE=pcx256 -r150x150 -sOutputFile="$1$2/tmp%d" "$1$2.infile"

   #from pcx->gif

   echo "<br>"
   for dff in $1$2/*
   do
       echo "Converting $dff"
       nice /usr/local/bin/convert "$dff" "$dff".gif
       rm "$dff"
   done
*********************************************************************
I'm wondering if it is possible for CM use this function to generate the preview image.

Ideally what I would like is the ability to upload a pdf and have the thumbnail be the first image generated, and have a mechanism to scroll throught the page images, but I would be happy with just a thumbnail for the first page.

Maybe I should post this in feature requests though?