Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Thumbnails from pdf's
Old 08-18-2004, 10:18 AM Thumbnails from pdf's
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
Dynmaically generated that is. Any ideas?

Ibbo
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
 
Register now for full access!
Old 08-18-2004, 10:51 AM
webwoRRks's Avatar
Ultra Talker

Posts: 426
Location: I hope so
Trades: 0
yes, with ImageMagick;

convert -size 100x100 -thumbnail 100x100 my_pdf.pdf thumb.jpg

This may not work (never tried it before)... read this site, it may help;
http://www.cs.wisc.edu/~ghost/
__________________
Theres 10 types of people; those who understand binary, and those who don't.
webmaster and webdeveloper resources,
Please login or register to view this content. Registration is FREE
webwoRRks is offline
Reply With Quote
View Public Profile Visit webwoRRks's homepage!
 
Old 08-19-2004, 07:55 AM
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
I was using imagemagick but couldnt reference a particular page.

After an hour of messing I made a break through.

The line you put up there does the trick but if the PDF has 100 pages then it makes an animated gif with all hundred pages.

To get around this you need

convert -resize 100x100 -thumbnail 100x100 my_pdf.pdf[0] thumb.jpg

of course my_pdf.pdf[0] makes a thumb from the first page of the PDF. So one and all if your using this through php's exec function make sure you reference the page by sticking an array element on the end of the PDF where [0] = page 1 [10] = page 11 etc, otherwise you will no doubt kill the server.

Any how if you dont want do do it through php I knocked up a simple little shell script to do the same thing.

Code:
#!/bin/bash
                                                                                                            
for dir in *
do
  cd $dir
    echo "in $dir"
    for subdir in *
    do
     cd $subdir
       echo "in $subdir"
         for file in `ls *.pdf`
          do
             echo "thumb nailing $file ..."
             convert -resize 120x120 $file[0] 120x120 $file.gif
          done
     cd ..
    done
    cd ..
done
On my server the pdf are stored in the folders
Rootdir
backcopies
Topdir
200* I.E 2001, 2002
subdir
Jan - Dec

The script should work providing you start in the root dir.

Ibbo
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Reply     « Reply to Thumbnails from pdf's
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37515 seconds with 12 queries