PDF thumbnail from first page of PDF PDF thumbnail from first page of PDF
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

PDF thumbnail from first page of PDF

Started by stevepaugh, March 27, 2005, 08:30:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stevepaugh

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!  :)

Tranz

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

stevepaugh

#2
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?