pdf preview ...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Kami
Forum Newbie
Posts: 2
Joined: Thu May 17, 2007 3:28 pm

pdf preview ...

Post by Kami »

Hi, I would like to list some pdfs files from a directory and generate some thumbnails to preview them !

How can I create an image from a pdf (only the first page) ?

What's the best way ?

Thanks
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

Maybe somebody else will have an easy way to do it, but I would suggest creating a .jpg file of the first page of each .pdf document, using screen capture.
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post by stereofrog »

ghostscript (http://www.cs.wisc.edu/~ghost/doc/GPL/index.htm) is an open-source command-line tool that can, among other things, create jpg images from pdf files. Just invoke it from php via exec().
Kami
Forum Newbie
Posts: 2
Joined: Thu May 17, 2007 3:28 pm

Post by Kami »

stereofrog wrote:ghostscript (http://www.cs.wisc.edu/~ghost/doc/GPL/index.htm) is an open-source command-line tool that can, among other things, create jpg images from pdf files. Just invoke it from php via exec().
Thanks !
Post Reply