PDF Thumbnail - RMagick

Hi,

I need to create a preview of a PDF upload to a CMS I’m building. Does
anyone know how to create a thumbnail of the first page of a PDF using
RMagick?

Any ideas welcome,

~ Mark

Mark D. wrote:

I need to create a preview of a PDF upload to a CMS I’m building. Does
anyone know how to create a thumbnail of the first page of a PDF using
RMagick?

PDF is outside RMagick’s (huge) envelop (IIRC). Google PDF2PNG.

PNG is the politically-correct (and slightly more technically advance)
way to do what GIF did. (And now that GIF is legal, it’s no fun
anymore!!)


Phlip
http://c2.com/cgi/wiki?ZeekLand ← NOT a blog!!

PDF is outside RMagick’s (huge) envelop (IIRC)

But you can do this with Image Magick? Are you sure?

Google PDF2PNG.

There are lots of apps, but I want a nice Ruby way to do this, without
having to resort to backticks!

Mark D. wrote:

But you can do this with Image Magick? Are you sure?

$ convert betty-boop.jpg boop.pdf
$ ls
betty-boop.jpg boop.pdf

My bad. It seems to be available on my system. (Mac OYesSex).

Check your delegates.xml file


Phlip
http://c2.com/cgi/wiki?ZeekLand ← NOT a blog!!

Phlip wrote:

Mark D. wrote:

I need to create a preview of a PDF upload to a CMS I’m building. Does
anyone know how to create a thumbnail of the first page of a PDF using
RMagick?

PDF is outside RMagick’s (huge) envelop (IIRC). Google PDF2PNG.

ImageMagick (and therefore RMagick) can read and write PDF if you have
Ghostscript installed.