What method is best for generating thumbnails in PHP from PDF"s?

What method is best for generating thumbnails in PHP from PDF"s?

am 12.11.2009 18:10:32 von chris_payne

Hi Everyone,

I have been asked to create thumbnails from the first page of a PDF
document on the fly with PHP, I have looked online but am confused as
there doesn't seem 1 simple solution.

What would you all recommend as an easy way to do this?

Any help would be really appreciated.

Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: What method is best for generating thumbnails in PHP fromPDF"s?

am 12.11.2009 18:44:36 von olavell

Chris Payne wrote:

> Hi Everyone,
>
> I have been asked to create thumbnails from the first page of a PDF
> document on the fly with PHP, I have looked online but am confused as
> there doesn't seem 1 simple solution.
>
> What would you all recommend as an easy way to do this?
>
> Any help would be really appreciated.

I think I would just call an external program to do it, like "convert"
from Image Magick:

exec("convert -thumbnail 300x300 document001.pdf[0] thumbnail001.png");


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: What method is best for generating thumbnails in PHP from PDF"s?

am 12.11.2009 18:45:55 von Stephen

--- On Thu, 11/12/09, Chris Payne wrote:

> I have been asked to create thumbnails from the first page
> of a PDF
> document on the fly with PHP, I have looked online but am
> confused as
> there doesn't seem 1 simple solution.

Go to sitepoint.com and search for "photo gallery in minutes"

Excellent article.

Stephen



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: What method is best for generating thumbnails in PHPfrom PDF"s?

am 12.11.2009 21:28:25 von Joseph Masoud

On 12/11/09 17:44, O. Lavell wrote:
> Chris Payne wrote:
>
>> Hi Everyone,
>>
>> I have been asked to create thumbnails from the first page of a PDF
>> document on the fly with PHP, I have looked online but am confused as
>> there doesn't seem 1 simple solution.
>>
>> What would you all recommend as an easy way to do this?
>>
>> Any help would be really appreciated.
> I think I would just call an external program to do it, like "convert"
> from Image Magick:
>
> exec("convert -thumbnail 300x300 document001.pdf[0] thumbnail001.png");
>
>
If you're going to use ImageMagick, make sure you have the latest
ghostscript library, otherwise not all thumbnails will render properly.

I don't recommend CentOS for this task. If this is your server OS, I
recommend considering this rpm:

http://www.clearfield.com/ghostscript.8.64/ghostscript.html

Good luck.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: What method is best for generating thumbnails in PHP from PDF"s?

am 13.11.2009 01:03:08 von Clancy

On Thu, 12 Nov 2009 09:45:55 -0800 (PST), stephen-d@rogers.com (Stephen) wrote:

>--- On Thu, 11/12/09, Chris Payne wrote:
>
>> I have been asked to create thumbnails from the first page
>> of a PDF
>> document on the fly with PHP, I have looked online but am
>> confused as
>> there doesn't seem 1 simple solution.
>
>Go to sitepoint.com and search for "photo gallery in minutes"

Sitepoint: Home » Search for "photo gallery in minutes"

doesn't find anything for me?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: What method is best for generating thumbnails in PHP from

am 15.11.2009 05:15:27 von geek.de

--00151774098c94c09b0478612424
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi, I've spent ages trying to figure out a good way for this. Ghostscript
and ImageMagick were slow and not giving satisfactory results because the
colors were wrong in some instances.

The solution for me was to use ImageMagick with X-PDF. You can install xpdf
in any linux distro or even on windows. It has a neat little program called
pdf2ppm which converts a PDF into a bitmap format which convert from
imagemagick can then transform. Even though the ppm images are huge, it
seems to work faster than using just convert.

++Tim Hinnerk Heuer++

http://www.ihostnz.com


2009/11/13

> On Thu, 12 Nov 2009 09:45:55 -0800 (PST), stephen-d@rogers.com (Stephen)
> wrote:
>
> >--- On Thu, 11/12/09, Chris Payne wrote:
> >
> >> I have been asked to create thumbnails from the first page
> >> of a PDF
> >> document on the fly with PHP, I have looked online but am
> >> confused as
> >> there doesn't seem 1 simple solution.
> >
> >Go to sitepoint.com and search for "photo gallery in minutes"
>
> Sitepoint: Home » Search for "photo gallery in minutes"
>
> doesn't find anything for me?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--00151774098c94c09b0478612424--