PHP: Generate Image Thumbnail from .PDF, .DOC, and .DOCX in Linux

JustinBull picture JustinBull · Mar 30, 2011 · Viewed 9.6k times · Source

As the title says,

I'm essentially looking for a way to generate a thumbnail from a .DOC, .DOCX, or .PDF file uploaded to the linux machine.

I understand ImageMagick can handle .PDF to .PNG conversion and is made even easier with PHP's IMagick but I am unsure about .DOC or .DOCX. I think I was told a headless version of OpenOffice can do this.

Answer

Andrew Fenn picture Andrew Fenn · Aug 17, 2011

Haven't tested it myself yet however ooo-thumbnailer can apparently make thumbnails of DOC, DOCX and PDF files from version .31 and up.

The project is available from here: https://launchpad.net/ooo-thumbnailer

This is a subject that I've spent a long time searching myself and it seems that this is probably your best bet.