Re: Can GD make a JPG thumbnail of a PDF?
| From: | Tim | iHostNZ | Date: | Thu, 11 Dec 2008 01:06:23 +0000 |
| Subject: | Re: Can GD make a JPG thumbnail of a PDF? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284452@lists.php.net to get a copy of this message | ||
On Thu, Dec 11, 2008 at 1:59 PM, Stephen Johnson <maillists@thelonecoder.com
> wrote:
> I think you want something like this :
> exec("convert -density 360x360 -enhance $pdfFile $pdfFile.gif");
Yes, that's how i did it here. Didn't find a better solution yet. Was
looking at the php module for imagemagick (imagick i believe), but that
seemed not quite there yet for deployment. Please advise if someone got that
working. Would prefer this over a shellexecute. You will need to install
imagemagick and i believe you also need ghostscript for this to work. You
can get both for linux and windows, free.
On debian and ubuntu and such:
apt-get install imagemagick gs
>
>
>
> On 12/10/08 4:48 PM, "Brian Dunning" <brian@briandunning.com> wrote:
>
> > I've spent most of the last week trying to get ImageMagick working on
> > my Windows PHP installation. I gather that since I'm going to be
> > converting PDFs to JPEGs, I need Ghostscript.
> >
> > Well, I've got ImageMagick installed:
> > http://printhq2.com/info.php
> > I ran a Ghostscript installer, but it didn't seem to do very much.
> >
> > Some site advised me to test my installation like this:
> > <?php
> > echo "<pre>";
> > system("convert -version");
> > echo "</pre>";
> > ?>
> > But it just returns blank. Can anyone help me get ImageMagick working
> > on my server?
> >
> >
> > On Nov 20, 2008, at 4:41 PM, Stephen Johnson wrote:
> >
> >> No but you can use imagemagicks convert to convert the pdf to an
> >> image and
> >> then make a thumbnail of it.
> >
>
> --
> Stephen Johnson
> The Lone Coder
>
> http://www.ouradoptionblog.com
> *Join us on our adoption journey*
>
> stephen@thelonecoder.com
> http://www.thelonecoder.com
>
> *Continuing the struggle against bad code*
> --
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Tim-Hinnerk Heuer
http://www.ihostnz.com