Advanced search  

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]

Pages: [1]   Go Down

Author Topic: PDF thumbnail from first page of PDF  (Read 4489 times)

0 Members and 1 Guest are viewing this topic.

stevepaugh

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
PDF thumbnail from first page of PDF
« 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!  :)
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: PDF thumbnail from first page of PDF
« Reply #1 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
Logged

stevepaugh

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: PDF thumbnail from first page of PDF
« Reply #2 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?
« Last Edit: March 27, 2005, 10:25:45 am by stevepaugh »
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.